Batch Operation Support
Document DB should support batch operations in REST API and SDK level. It would be very useful to insert 1000 entities in one transaction.
We released the bulk executor library for .NET and Java this past March that provides support for batch operations. For more information on this feature go to, https://docs.microsoft.com/en-us/azure/cosmos-db/bulk-executor-overview.
would be a nice to allow multiple deletes in Data explorer. Especially in dev environments. Seems every answer is build an app. How about some useful tools.
Is there going to be support for .NET Standard or .NET Core? The current library only supports the full .NET Framework. This is a problem for our customers who are moving to .NET Core.
Alexander, the sample is here. You can get to it by reading the "Next Steps" section of the documentation they linked.
Alexander Batishchev commented
The doc has zero code samples and zero links to additional reading. Good job!
This is a double-edged sword, I think.
Putting in some automatic way to do this is likely to make people unhappy with one way or another of doing it, as well as probably lead to spikes in performance.
I would actually suggest just having the bulk insert and bulk delete scripts stuffed into a common place somewhere, but I know supporting that with a world-wide, scalable DB might be difficult, or just get the way of other design tenants.
But for now, just including them in my project and managing them one time isn't that big of a deal.
This is sort of like the need to merge document contents, which is also supported very easily by a procedure, and the advantage of that is that the procedure can do more at the same time.
Chad Brockman commented
This is very easy to do in Google Datastore (just pass an array of objects and get an array of results) and MongoDB.
Cosmos should support this.
We would love this for delete as well. CosmosDb is so awesome. Make it more awesome.
Instead of everyone having add a bulkInsert proc to every collection, why not build this into the Cosmos DB framework? Seems like a simple thing to add. Dealing with procs is a pain. At the very least, add some code to your samples on Github that show how to use the .NET SDK to invoke these procs.
How can something so basic possibly be "unplanned". Why is everything about CosmosDB so weird?
If you have a list of URIs (selflinks or UriFactory.CreateDocumentLink()) I think you should be able to Delete or Get them.
It seems daft that Azure Search supports this, but not DocumentDb.
This would help me do more things with DocumentDB
Bryan Tharpe commented
I would love to see this added. We are using DocumentDB to store reference data and the load times of a large amount of records using the API is very bad. Some of our reference datasets will be 300k+ documents in a load, happening once a week. If we use a stored procedure its much faster, but then we're limited to having to have this stored procedure added to any collection we want to use for reference data instead of just using an API.
Felix Schröter commented
I'd like to see that, too. Especially including query capabilities (to support Where statements, etc.) when not having the ID of the document.
Querying all documents just to get the IDs for deletion seems like a huge overhead.
M. Lowijs commented
This please, no support for bulk inserts drives me to MongoDB.
Jack Bond commented
This is similar to the popular request "Set based operations", but a method like CreateDocumentsAsync would be extremely helpful when multiple related documents need to be inserted in a single transaction.
Also requested in this place: http://feedback.azure.com/forums/263030-documentdb/suggestions/6435801-batch-operation-support
Also requested in this idea idea: http://feedback.azure.com/forums/263030-documentdb/suggestions/6714678-store-several-documents-in-one-step
Jan V commented
O delete 1000 entities in one transaction...
Praneet Loke commented
Batch insert without using a stored procedure would be fantastic!
Hi Leonid Ganeline,
I'm trying to make a stored procedure which manage insert or replace of multiple documents, but it's too hard to do that without a debugger...
We have all the item to suceed:
The BULK INSERT:
AND THE UPSERT for one document...
If you can do that it could be a good step...!