Created
April 22, 2020 22:35
-
-
Save gdhuper/e67cec8623ae0c969cddb1a77fe61f75 to your computer and use it in GitHub Desktop.
cosmos-rust-getting-started-main-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
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