I have a VS2017 solution in C#, and I'm using IDocumentClient.UpsertDocumentAsync to Upsert some documents into my cosmosdb documentdb collection. But I noticed it's actually creating new documents with the same id while there already is a document in the collection with that id.
Now after upserting a new document with the same id the query result looks something like this:
select * from c where c.id = "aaaa-bbbb-cccc"
[
{
"id": "aaaa-bbbb-cccc",
"firstname": "john",
"lastname": "doe"
},
{
"id": "aaaa-bbbb-cccc",
"firstname": "john",
"lastname": "doe",
"age": "35"
}
]
I'm quite confused with this behavior; maybe I don't properly understand the definition of "upsert". Would appreciate if anyone can clarify this for me.