Skip to content

PHPLIB-659 Support options for time-series collections #829

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 29, 2021

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented May 31, 2021

@alcaeus alcaeus requested a review from jmikola May 31, 2021 08:11
@alcaeus alcaeus self-assigned this May 31, 2021
description: |
Available on 5.0+ servers only

Allows users to specify options for time-series collections.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I haven't found additional documentation for this param publicly yet, so I've only stubbed out documentation. I suggest we revisit this closer to the 5.0 release cycle if at all. In that case, I'd create a follow-up ticket, but I'm also fine linking to the command documentation for more information.

@alcaeus alcaeus changed the title PHPLIB-659 Support options for time-series collections [WAIT] PHPLIB-659 Support options for time-series collections Jun 1, 2021
@alcaeus
Copy link
Member Author

alcaeus commented Jun 2, 2021

Updated to incorporate changes from DRIVERS-1774 and DRIVERS-1779. Note that the docs are very vague at this point, but I was not able to find any public documentation for these fields yet. Should we create a ticket to follow up on documentation before the release of 1.9?

@alcaeus alcaeus requested a review from jmikola June 2, 2021 11:11
@alcaeus alcaeus changed the title [WAIT] PHPLIB-659 Support options for time-series collections PHPLIB-659 Support options for time-series collections Jun 2, 2021
@jmikola
Copy link
Member

jmikola commented Jun 2, 2021

Should we create a ticket to follow up on documentation before the release of 1.9?

Yes. I'd suggest talking to @agolin95 about that in case a separate DRIVERS ticket would be useful. We can then have that block on a relevant ticket for the server manual itself. In this case, I don't think we really need to document the internal structure of timeseries in our documentation, but it'd be nice to have an actual URL in the server manual to link to for reference.

@alcaeus alcaeus removed the request for review from jmikola June 24, 2021 13:55
@alcaeus
Copy link
Member Author

alcaeus commented Jun 25, 2021

@jmikola rebased on top of master and ensured that the spec test is up to date. Ready for a final review.

Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with my suggestions for doc changes.

name: expireAfterSeconds
type: integer
description: |
Available on 5.0+ servers only
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on existing docs, this should be phrased as:

This option is available in MongoDB 5.0+ and will result in an exception at execution time if specified for an older server version.

Alternatively (as is done later in this file for writeConcern):

This is not supported for server versions prior to 5.0 and will result in an exception at execution time if used.

In both cases, these lines are typically added after any documentation describing the option's functionality. For instance, the writeConcern docs later in this file add that using post:.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated the documentation as suggested. Thanks!

name: timeseries
type: array|object
description: |
Available on 5.0+ servers only
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as expireAfterSeconds.

operation: ~
optional: true
post: |
.. versionadded:: 1.9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as expireAfterSeconds.

operation: ~
optional: true
post: |
.. versionadded:: 1.9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

post: is generally only helpful if we're inheriting common docs. In this case, it'd be more consistent with existing docs to just append this after two line breaks at the end of description.

@@ -167,6 +179,10 @@ public function __construct($databaseName, $collectionName, array $options = [])
throw InvalidArgumentException::invalidType('"storageEngine" option', $options['storageEngine'], 'array or object');
}

if (isset($options['timeseries']) && ! is_array($options['timeseries']) && ! is_object($options['timeseries'])) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reading this again with fresh eyes, I find it very odd that the server team didn't use camelCase for this option name (vs. expireAfterSeconds).

@alcaeus
Copy link
Member Author

alcaeus commented Jun 29, 2021

Build failures are addressed in #835, merging despite failing CI.

@alcaeus alcaeus merged commit 2407bc4 into mongodb:master Jun 29, 2021
@alcaeus alcaeus deleted the phplib-659 branch June 29, 2021 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants