---
title: "Documents: Compare Exchange View"
description: "* Compare-Exchange are cluster-wide key/value pair items where the key"
url: "https://docs.ravendb.net/6.2/studio/database/documents/compare-exchange-view"
version: "6.2"
---

# Documents: Compare Exchange View

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Documents: Compare Exchange View

> **Note**
>
> - [Compare-Exchange](https://docs.ravendb.net/6.2/client-api/operations/compare-exchange/overview.md) 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](https://docs.ravendb.net/6.2/client-api/session/cluster-transaction/atomic-guards.md)  
>     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](https://docs.ravendb.net/6.2/client-api/operations/compare-exchange/overview.md)
>   - [Session - Cluster Transaction](https://docs.ravendb.net/6.2/client-api/session/cluster-transaction/overview.md)
>   - Using the [RavenDB Studio](#the-compare-exchange-view)
>
> - In this page:
>   - [The Compare Exchange View](#the-compare-exchange-view)

## The Compare Exchange View

![Compare Exchange View](https://docs.ravendb.net/assets/images/compare-exchange-view-419691168ff15f70513ddc3457b79369.png)

1. **Documents Tab**  
   Select to see document-related options and the list of documents in this database .
2. **Compare Exchange**  
   Select to see the Compare Exchange view.
3. **Add new item**  
   Click to add a new compare exchange key/value pair.
4. **Compare exchange key/value properties**  
   Click the edit button or key name to edit this item.  
   ![Compare Exchange Single Pair](https://docs.ravendb.net/assets/images/compare-exchange-single-pair-e63bf04638be7eb9f2aeaeda36f49958.png)
   1. **Key**  
      A unique identifier that is reserved across the cluster.  
      Enter any string of your choice.

      > **Info:** Atomic Guards {#atomic-guards}
      >
      > If keys start with "rvn-atomic", they are [Atomic Guards](https://docs.ravendb.net/6.2/client-api/session/cluster-transaction/atomic-guards.md).  
      > 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](https://docs.ravendb.net/assets/images/compare-exchange-atomic-guard-ce7c98b5714ea794b0f2787f162cbff3.png)
   2. **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.
   3. **Metadata**  
      Click to add metadata.  
      The metadata is associated with the key, similar to document's metadata.
   4. **Raft Index**  
      The raft index increments automatically each time the value or metadata are changed, indicating the compare-exchange item's
      current version.
   5. **Delete**  
      Click to delete this compare exchange item.
      > **Warning:** Warning {#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.
   6. **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.
