Skip to content

Instantly share code, notes, and snippets.

@gdhuper
Created April 22, 2020 22:35
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/e67cec8623ae0c969cddb1a77fe61f75 to your computer and use it in GitHub Desktop.
Save gdhuper/e67cec8623ae0c969cddb1a77fe61f75 to your computer and use it in GitHub Desktop.
cosmos-rust-getting-started-main-update
let task_update = InsertableTask::new(
   "Pay AmeX bill".to_string(),
   "Bill".to_string(),
   UtcDateTime(Utc::now()),
   UtcDateTime(Utc.ymd(2020, 04, 28).and_hms(12, 0, 9)),
   true,
);
let update_doc: Document = task_update.into();
let updated = mongo_client.update(update_filter, update_doc).unwrap();
match updated {
   Some(result) => println!("Number of documents updated: {:?}", result),
   None => println!("Failed to update the document"),
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment