Replies: 1 comment
-
|
If the requirement is a specific order, then it needs to explicitly specify in the query to honor it. Otherwise, there are no guarantees. Unique key is scoped to a single logical partition key and if it's matches your requirement then its right way to do it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I just wanted to try a case where there are multiple same requests. Test logic is pretty simple. Application attempts to create a document on Cosmos db if there is no document found after searching by property value.
When I sent the same 100 requests to the application simultaneously, it created 100 documents. I guess creation 100 documents requests were sent before the first document is created.
So, in order to receive same document even if they all created different documents, I added one more query after creation like below.
I found that last GetByCertainProperty returns always same document among 100 documents. I wonder how this is ordered and this order is guaranteed all the time.
Also, is there a better approach I can use to prevent duplicated documents except unique key and stored procedure?
Beta Was this translation helpful? Give feedback.
All reactions