title: Compare and Swap : How to map the cas metadata field to document entity of my couchbase
body: <p>I am using spring data to fetch documents from couchbase and i need to map the check and set metadata field <strong>cas</strong> to my document in order to implement the optimistic lock.</p>
  
  <p>how can i do it without using n1ql query?</p>
  
  <p><a href="https://docs.couchbase.com/java-sdk/2.7/concurrent-mutations-cluster.html" rel="nofollow noreferrer">CAS reference in Couchbase</a></p>
  
  <p>Thanks</p>