-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
hallettj has created PR #1003: fix: list_collections fails with MongoDB Atlas database with time-series collection in mongo-rust-driver
Issue Text:
When creating a time-series collection on MongoDB Atlas the `clusteredIndex` field of the collection options is given as `true` instead of as an object that deserializes to `ClusteredIndex`. The rust driver does not expect a boolean in that position, so parsing `CreateCollectionOptions` fails. This causes methods such as `db.list_collections()` to fail.
This change adds a custom deserializer that handles the case where `clusteredIndex: true` by filling in the default value for `ClusteredIndex`.
I don't know if `clusteredIndex: false` is a valid state so in the interest of being conservative I have made that an error case in the custom deserializer.