Documents: Compare Exchange View
-
Compare-Exchange are cluster-wide key/value pair items where the key is a unique identifier in the database.
-
CmpXchg items coordinate work between sessions that are trying to modify a shared resource (such as a document) at the same time.
-
Compare exchange items are created and managed by either of the following:
- RavenDB Atomic Guards
To guarantee ACIDity across the cluster, as of RavenDB 5.2, we automatically create and maintain Atomic Guard CmpXchg items in cluster-wide sessions. - API Operations
- Session - Cluster Transaction
- Using the RavenDB Studio
- RavenDB Atomic Guards
-
In this page:
The Compare Exchange View
Compare Exchange View
- Documents Tab
Select to see document-related options and the list of documents in this database . - Compare Exchange
Select to see the Compare Exchange view. - Add new item
Click to add a new compare exchange key/value pair. -
Compare exchange key/value properties
Click the edit button or key name to edit this item.
-
Key
A unique identifier that is reserved across the cluster.
Enter any string of your choice.
Atomic Guards
If keys start with "rvn-atomic", they are Atomic Guards.
They are created and maintained automatically to guarantee ACID cluster-wide transactions.
Do not remove or edit these as this will disable ACID guarantees.Atomic Guard
- Value
Enter a value that will be associated with the key.
Values can be numbers, strings, arrays, or objects. Any value that can be represented as JSON is valid. - Metadata
Click to add metadata.
The metadata is associated with the key, similar to document's metadata. - Raft Index
The raft index increments automatically each time the value or metadata are changed, indicating the compare-exchange item's current version. - Delete
Click to delete this compare exchange item.
Warning
Deleting a compare exchange item will remove ACID guarantees for transactions if the pair was set up to protect ACIDity.
Only remove or edit these if you truly know what you're doing. - Save
Save will only succeed if the Raft Index version that is currently stored within RavenDB for this key matches the version that shows in the view.
-