Check and Set


#1

I wrote an application using version 2.0 and node.js couchbase library using the 2.0 c library. In that application I would use the SET command to save the results to the bucket and when viewing the document it would look something like this:
{
“first_name”: “John”,
“last_name”: “smith”
}

I then needed the ability to connect to multiple buckets so I upgraded to 2.1.0 library and used a method to connect to a particular bucket specified in the connection.
The issue that I have now is that all my documents when I call the SET command look like this:
{
“cas”: {
“0”: 248584192,
“1”: 526817186
},
value{
“first_name”: “John”,
“last_name”: “smith”
}

I read through the documentation and I could not find a way to just get the document to save without the Check and Set. How can I accomplish this?
Thanks


#2

Hi.

The CAS is always supplied because the server always sends it. You can feel free to ignore the ‘cas’ field and just inspect the ‘value’ field