Skip to content

Instantly share code, notes, and snippets.

@gdhuper
Created April 22, 2020 22:24
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/9db249a05e94fd9b91b4ac66b4783d85 to your computer and use it in GitHub Desktop.
Save gdhuper/9db249a05e94fd9b91b4ac66b4783d85 to your computer and use it in GitHub Desktop.
cosmos-rust-getting-started-create
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