You can set optimistic concurrency = true to get RavenDB to check it for you. see: http://ravendb.net/kb/16/using-optimistic-concurrency-in-real-world-scenarios
Can you prevent RavenDB from overwriting a document that has been manually inserted?
-
16-07-2023 - |
Pergunta
I had a document in my Beta RavenDB instance with an id of:
document-65
I created a new RavenDB instance (Live) and copied the document from Beta to Live - opened the RavenDB Management, clicked on New
and pasted the contents of the document into the 'Data' bit. I gave it the ID: document-65
as in the Beta.
All was working well, until someone recently created a new Document and overwrote the existing one. I did the copy this way as I had one document to copy, so time-wise this seemed quickest and most effective.
I presume it's Raven auto generating an ID for me, and that's something I'll have to live with now, but what I want to know is:
Can I prevent this happening?
Can I tell HiLo (or whatever) to use ID's > 65 from now on in? (If I did this again)
Solução