Created
April 22, 2020 22:37
-
-
Save gdhuper/850d0ed468314f183d0d815abcf5ad23 to your computer and use it in GitHub Desktop.
cosmos-rust-getting-started-db-delete
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 delete(&self, doc: Document) -> Result<i64, Error> { | |
let collection = &self | |
.client | |
.get_db(&self.database) | |
.get_collection(&self.collection); | |
match collection.delete_one(doc, None) { | |
Ok(result) => Ok(result.deleted_count), | |
Err(e) => Err(e), | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment