In Cosmos DB I can (thanks to the SO Community) insert a document like so:
data = {'attribute1':1, 'attribute2': 2}
client.CreateDocument('dbs/databaseName/colls/collectionName/', data)
It would be great if I could insert multiple documents at a time, like how in SQL you can do:
insert into table values (1, 2), (3,4), (5,6)
I understand that you can do bulk uploads with stored procedures, but if I could basically concat a bunch of documents together I think that would work better for me (...or at least save me learning how to write stored produces at this moment).
You're correct in that you can insert multiple documents via a stored procedure.
However: There are no api calls to insert multiple documents at once. You must execute one call per document insert (whether done from your app, or from a stored procedure).
The stored procedure approach will give you a less-chatty set of calls (essentially a single call), and be transactional (all or none succeed).
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