title: What is CAS in NoSQL and how to use it?
body: <p>Write operations on Couchbase accept a parameter <code>cas</code> (create and set). Also the return result object of any non-data fetching query has <code>cas</code> property in it. I Googled a bit and couldn't find a good conceptual article about it. </p>
  
  <p>Could anyone tell me when to use <em>CAS</em> and how to do it? What should be the common work-flow of using <em>CAS</em>?</p>
  
  <p>My guess is we need to fetch <em>CAS</em> for the first write operation and then pass it along with next write. Also we need to update it using result's <em>CAS</em>. Correct me if I am wrong.</p>