-
Type: Task
-
Resolution: Won't Fix
-
Priority: Unknown
-
None
-
Affects Version/s: None
-
Component/s: None
Denys-Bushulyak has created PR #402: feat: add ability to generate ObjectId from SystemTime in bson-rust
Issue Text:
Hi, dear folks!
This PR adds the ability to generate an ObjectId from SystemTime. I found it useful because sometimes there is a need to create records in MongoDB from the "past" and use the nice ability of MongoDB to sort by ObjectId.
In the official documentation [page](https://www.mongodb.com/docs/manual/reference/method/ObjectId/#mongodb-method-ObjectId), there is a description of the ability to create an ObjectId from a hex and unix epoch timestamp, but I didn't find the ability to create one from a timestamp in the Rust Crate. However, since we are already there, I have decided to implement it using SystemTime as a first step. If you find it useful, I will be glad, because I think it would be better to extend the official crate rather than creating a separate one for this ability.