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
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustfmt
  • Loading branch information
abr-egn committed Jun 29, 2021
commit cf1c6a20d479f75d694d3f0d8fafc0bd03660a57
3 changes: 2 additions & 1 deletion src/db/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ pub struct CreateCollectionOptions {
#[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.

deserialize_with = "bson_util::deserialize_duration_from_u64_seconds",
serialize_with = "bson_util::serialize_duration_option_as_int_secs")]
serialize_with = "bson_util::serialize_duration_option_as_int_secs"
)]
pub expire_after_seconds: Option<Duration>,
}

Expand Down
4 changes: 1 addition & 3 deletions src/test/spec/collection_management.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use crate::{
test::{run_spec_test, LOCK},
};
use crate::test::{run_spec_test, LOCK};

use super::run_unified_format_test;

Expand Down