Created
April 22, 2020 22:24
-
-
Save gdhuper/9db249a05e94fd9b91b4ac66b4783d85 to your computer and use it in GitHub Desktop.
cosmos-rust-getting-started-create
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 = InsertableTask::new( | |
"Pay AmeX bill".to_string(), | |
"Bill".to_string(), | |
UtcDateTime(Utc::now()), | |
UtcDateTime(Utc.ymd(2020, 04, 28).and_hms(12, 0, 9)), | |
false, | |
); | |
let document: Document = task.into(); | |
let insert_result = mongo_client.create(document)?; | |
println!("Inserted document id: {:?}", insert_result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment