I have Documents list(object) that object has multiple documents i.e. Json records are present but while I try to upload that Bunches of Document(Records) it not upload on document DB but while I upload Single Document records it upload succesfully.
List<MyModelClass> listObj = new List<MyModelClass>();
Document doc = await DocumentClient.CreateDocumentAsync("dbs/" + DocumentDatabase.Id + "/colls/" + DocumentCollection.Id, listObj);
above code is not working.....
foreach (var item in listObj )
{
Document doc = await Client.CreateDocumentAsync("dbs/" + DocumentDatabase.Id + "/colls/" + DocumentCollection.Id, item);
}
This code is working for me.....
Syntax : CreateDocumentAsync(String, Object, RequestOptions, Boolean)
Object :- Document object // I Know it as per syntax it need to be "Document Type".
I want any Other way to Upload All Document at Once....
Introduction to insertMany() in PyMongo If you're using MongoDB to store data, there will be times when you want to insert multiple documents into a collection at once. It's easy to accomplish this task with Python when you use the collection. insert_many() method.
It is possible now to insert multiple documents at once by using Microsoft.Azure.CosmosDB.BulkExecutor library
https://docs.microsoft.com/en-us/azure/cosmos-db/bulk-executor-dot-net
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With