Details
-
Bug
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
Description
SDKs must implement a way to submit multiple values so that they are encoded in such a manner
So that I would expect the following code result in {"hits":[1,2,3,4,5]}, but currently arrayAppendAll does not exist
var couchbase = require("couchbase");
|
|
var cluster = new couchbase.Cluster('couchbase://localhost');
|
cluster.authenticate('Administrator', 'password');
|
|
var bucket = cluster.openBucket('default');
|
bucket.upsert('foo', {'hits': [1, 2, 3]},
|
function (err, res) {
|
if (!err) {
|
bucket.mutateIn('foo').arrayAppendAll('hits', [4, 5])
|
.execute(function(err, res) {
|
if (err) {
|
console.log("error: ", err);
|
process.exit();
|
}
|
bucket.get('foo', function (err, res) {
|
if (err) {
|
console.log("error: ", err);
|
} else {
|
console.log("value: %j", res);
|
}
|
process.exit();
|
});
|
});
|
}
|
}
|
);
|
See also: https://forums.couchbase.com/t/arrayappend-in-node-sdk-multiple-addition/14808