I have a single collection into which I am inserting documents of different types. I use the type parameter to distinguish between different datatypes in the collection. When I am inserting a document, I have created an Id field for every document, but Cosmosdb has a built-in id field.
How can I insert a new document and retrieve the id of the created Document all in one query?
I think you just need to
.getResource()method to get the create document obj.Please refer to the java code:
C# code:
Hope it helps you.