Skip to content

Instantly share code, notes, and snippets.

@gdhuper
Created April 22, 2020 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdhuper/850d0ed468314f183d0d815abcf5ad23 to your computer and use it in GitHub Desktop.
Save gdhuper/850d0ed468314f183d0d815abcf5ad23 to your computer and use it in GitHub Desktop.
cosmos-rust-getting-started-db-delete
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