Hi Nitesh,
You will need Couchbase 6.5 or later to do this. Let’s say you want to remove field “remove_this” from documents in bucket named “my_bucket”. Here’s how you’d configure the eventing handler:
Source Bucket:
Set source bucket to the bucket of interest, my_bucket
Bindings:
Define this alias in function settings to allow the function to write to the bucket:
AliasName = bkt, Bucket = my_bucket, Access = Read+Write
Function:
function OnUpdate(doc, meta) {
if (doc.removethis) {
delete doc.removethis; // remove the field
bkt[meta.id] = doc; // write it back to the bucket
}
}
If you wish to speed it up, you can add more eventing nodes to the cluster.
Best Regards,
Siri