If I try to upsert a document with an id and partition key that already exists, it works as expected IF there are no Unique constraints set on the container.
However, when I set any value in the table as Unique, then the upsert doesn't work and I get a (409 conflict - a Document with an id matching the id field of document already exists). The Unique constraint shouldn't be a problem in this case, but it causes this error, which has a strange error description for an upsert because it shouldn't matter if the id already exists.
I'm using documentClient.upsertDocument(collectionLink, documentDefinition, null, true);
.