Description
var couchbase = require("couchbase");
|
|
// Connect to Couchbase Server
|
|
var cluster = new couchbase.Cluster('couchbases://10.142.151.101?ssl=no_verify');
|
var bucket = cluster.openBucket('default', function(err) {
|
if (err) {
|
throw err;
|
}
|
|
// Retrieve a document
|
bucket.get('u:king_arthur', function(err, result) {
|
if (err) {
|
// Failed to retrieve key
|
throw err;
|
}
|
var doc = result.value;
|
console.log("Read document: " + doc.email);
|
|
// Store a document
|
doc.comment = "Random beer from Norway";
|
bucket.upsert('u:king_arthur', doc, function(err, result) {
|
if (err) {
|
// Failed to replace key
|
throw err;
|
}
|
console.log(result);
|
|
// Re-read the document after writing.
|
bucket.get('u:king_arthur', function(err, result) {
|
if (err) {
|
throw err;
|
}
|
var doc2 = result.value;
|
console.log("Read updated comment: " + doc2.email + ", " + doc2.comment);
|
|
// Success!
|
process.exit(0);
|
});
|
});
|
});
|
});
|
hangs after the second replace.
Attachments
For Gerrit Dashboard: CCBC-744 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
73072,2 | CCBC-744: Request schedule_wants after calling SSL_write | master | libcouchbase | Status: MERGED | +2 | +1 |