Created
April 22, 2020 22:36
-
-
Save gdhuper/57f5f41433c63b48c131b26b72c83403 to your computer and use it in GitHub Desktop.
cosmos-rust-getting-started-db-update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn update(&self, filter: Document, update: Document) -> Result<Option<i64>, Error> { | |
let collection = &self | |
.client | |
.get_db(&self.database) | |
.get_collection(&self.collection); | |
match collection.update_one(filter, update, None) { | |
Ok(result) => Ok(Some(result.modified_count)), | |
Err(e) => Err(e), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment