Skip to content

RUST-666 Add options for timeseries collection creation #381

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 7 commits into from
Jun 30, 2021

Conversation

abr-egn
Copy link
Contributor

@abr-egn abr-egn commented Jun 29, 2021

No description provided.


/// Duration indicating after how long old time-series data should be deleted.
#[serde(
default,
Copy link
Contributor Author

@abr-egn abr-egn Jun 29, 2021

Choose a reason for hiding this comment

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

I don't know why this field needs to be explicitly marked as using the default when it's not present when others don't, but without this annotation some tests fail in deserialization complaining about missing field "expireAfterSeconds".

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's because we provide special serialization / deserialization helpers for this field which override the default behavior.

Copy link
Contributor

@patrickfreed patrickfreed left a comment

Choose a reason for hiding this comment

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

LGTM!


/// Duration indicating after how long old time-series data should be deleted.
#[serde(
default,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's because we provide special serialization / deserialization helpers for this field which override the default behavior.

Copy link
Contributor

@isabelatkinson isabelatkinson left a comment

Choose a reason for hiding this comment

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

looks good! just one doc request

@@ -83,6 +85,17 @@ pub struct CreateCollectionOptions {

/// The default configuration for indexes created on this collection, including the _id index.
pub index_option_defaults: Option<IndexOptionDefaults>,

/// Specifies options for creating a timeseries collection.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we document here that this feature is only available on 5.0+?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call, done.

@abr-egn abr-egn merged commit 021a11e into mongodb:master Jun 30, 2021
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.

3 participants