-
Notifications
You must be signed in to change notification settings - Fork 266
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
Conversation
description: | | ||
Available on 5.0+ servers only | ||
|
||
Allows users to specify options for time-series collections. |
There was a problem hiding this comment.
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.
docs/includes/apiargs-MongoDBDatabase-method-createCollection-option.yaml
Show resolved
Hide resolved
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? |
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 |
@jmikola rebased on top of master and ensured that the spec test is up to date. Ready for a final review. |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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:
.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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'])) { |
There was a problem hiding this comment.
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
).
Build failures are addressed in #835, merging despite failing CI. |
PHPLIB-659