skip to Main Content

Using the cursor in mongodb-rust sync

I took the code from the documentation, but it doesn't work. pub fn get_countries(&self) { let cursor = self.countries.find(None, None); for doc in cursor { println!("{}", doc?) } } mongodb::sync::Cursor<bson::Document> doesn't implement std::fmt::Display mongodb::sync::Cursor<bson::Document> cannot be formatted with the default…

VIEW QUESTION

MongoDB get only the last documents per grouping based on field

I have a collection "TokenBalance" like this holding documents of this structure { _id:"SvVV1qdUcxNwSnSgxw6EG125" balance:Array address:"0x6262998ced04146fa42253a5c0af90ca02dfd2a3" timestamp:1648156174658 _created_at:2022-03-24T21:09:34.737+00:00 _updated_at:2022-03-24T21:09:34.737+00:00 } Each address has multiple documents like of structure above based on timestamps. So address X can have 1000 objects with…

VIEW QUESTION
Back To Top
Search