Hi guys, i am trying to follow the hello couchbase example. But i keep getting the wrong output. My server console on command prompt keep getting
*"2016-06-13T15:44:49.193+08:00 WARNING: changeCache: Error unmarshaling doc “21st_amendment_brewery_cafe-amendment_pale_ale”: – db.(changeCache).DocChanged.func1() at change_cache.go:327"
while executing the hello-couchbase.js file the output is
Amendment Pale Ale, ABV: 5.2
{ cas: CouchbaseCas<62246400317204>, token: undefined }
it is a different output from the 1 stated in the tutorial
http://developer.couchbase.com/documentation/server/4.1/sdks/node-2.0/hello-couchbase.html
Config.Json
{
“log”: [“REST”],
“adminInterface”: “127.0.0.1:4985”,
“interface”: “0.0.0.0:4984”,
“databases”: {
“db”: {
“server”: “http://localhost:8091”,
“bucket”:“beer-sample”,
“users”:{
“GUEST”: {“disabled”: false, “admin_channels”: ["*"] }
}
}
}
}
hello-couchbase.js
var couchbase = require(“couchbase”);
// Connect to Couchbase Server
var cluster = new couchbase.Cluster(‘127.0.0.1’);
var bucket = cluster.openBucket(‘beer-sample’, function(err) {
if (err) {
// Failed to make a connection to the Couchbase cluster.
throw err;
}
// Retrieve a document
bucket.get(‘21st_amendment_brewery_cafe-amendment_pale_ale’, function(err, result) {
if (err) {
// Failed to retrieve key
throw err;
}
var doc = result.value;
console.log(doc.name + ', ABV: ' + doc.abv);
// Store a document
doc.comment = "Random beer from Norway";
bucket.replace('21st_amendment_brewery_cafe-amendment_pale_ale', doc, function(err, result) {
if (err) {
// Failed to replace key
throw err;
}
console.log(result);
// Success!
process.exit(0);
});
});
});