Inserting documents to collections in database in MongoDB deployment
use mongodb::bson::{doc, Document};
// Get a handle to a collection in the database.
let collection = db.collection::<Document>("books");
let docs = vec![
doc! { "title": "1984", "author": "George Orwell" },
doc! { "title": "Animal Farm", "author": "George Orwell" },
doc! { "title": "The Great Gatsby", "author": "F. Scott Fitzgerald" },
];
// Insert some documents into the "mydb.books" collection.
collection.insert_many(docs, None).await?;