like this
{
id:1,
name:john,
role:[
{name:boss, type:xyz},
{name:waiter, type:abc}
]
}
i want to add array of objects to "role" without losing other data, but new data should add to array as a objects.
i have tried with
bucket.upsert(key, data, (error: CouchbaseError | null, result: any) => {})
where key is a id of document and data is {name:boss, type:xyz} it shows key already exist.
for db.upsert it replace whole data with new data.
var query = N1qlQuery.fromString('UPDATE `myBucket` SET role = ' + '"' + data + '"' + ' WHERE meta().id =' + '"' + key + '"');
above code shows role:[object object] in database.