CRUD 基本操作
插入数据
bucket.insert('xiaoming', {"age":18, "sex": "boy"}, function(err, result) {
if (err) throw err;
console.log(result);
});
更新或者插入数据

更新替换数据
查询数据
查询数据查询多个KEY数据
删除数据
Last updated
bucket.insert('xiaoming', {"age":18, "sex": "boy"}, function(err, result) {
if (err) throw err;
console.log(result);
});

查询数据Last updated
bucket.upsert('xiaoming', {"age":18, "sex": "boy", "country": "china"}, function(err, result) {
if (err) throw err;
console.log(result);
});bucket.replace('xiaoming', {"age":18, "sex": "boy", "country": "china", "language": "chinese"}, function(err, result) {
if (err) throw err;
console.log(result);
});bucket.get('xiaoming', function(err, result) {
if (err) throw err;
console.log(result.value);
});js{ age: 18, sex: 'boy', country: 'china', language: 'chinese' }bucket.insert('revin', {"age":28, "sex": "boy", "country": "china", "language": "chinese"}, function(err, result) {
if (err) throw err;
//console.log(result);
});
bucket.getMulti(['xiaoming',"revin"], function(err, result) {
if (err) throw err;
console.log(result);
});{ xiaoming:
{ cas: CouchbaseCas<1533176100324966400>,
value: { age: 18, sex: 'boy', country: 'china', language: 'chinese' } },
revin:
{ cas: CouchbaseCas<1533176505367986176>,
value: { age: 28, sex: 'boy', country: 'china', language: 'chinese' } } }bucket.remove('revin', function(err, result) {
if (err) throw err;
console.log(result);
});