I am currently building a rust app which relyes on mongodb. I am struggeling to create the struct for documents without manuanlly setting them. I need to be able to access the _id. I am currently using the bson::default() however, I am conserned that the Id may be already used within the database. Is this a correct approch or is there a diffrent way to access the _id while letting the mongo driver assign an id.
Thank you for reading.
Skip to main content
New & Unread Topics
Topic | Replies | Views | Activity |
---|---|---|---|
How is the requestID field in OP_MSG packets generated? | 0 | 323 | Apr 2024 |
Rust driver - pool size set to 20, but seeing 1,000+ connections per company ops team | 0 | 506 | May 2024 |
How to filter items in collection with UUID subtybe 3 and 4? | 1 | 926 | Jun 2024 |
Compile error when building Mongocxx driver with gcc-14 | 2 | 437 | Jul 2024 |
Error “writeConcern is not allowed within a multi-statement transaction” with JAVA driver, Replica and @Transactional | 2 | 274 | Aug 2024 |