I am new to couchbase and couchnode. Considering couchnode Documentation, upsert callback function only return err and CAS. I want to get updated or inserted object in response. How can I do this?
Below is documentation detail for upsert function.
upsert(tuples, [options,] callback) → Bucket
- tuples: tuple (object with keys and respective values)
options: object
cas: The CAS value to check. If the key on the server contains a
different CAS value, the operation will fail. Note that if this
option is undefined, no comparison will be performed. For details on passing the CAS token for each of the keys, check Per key options.expiry (default 0): Expiration time of the key. If it's equal to zero, the item will never expire. You can also use Unix timestamp or a number of seconds starting from current time, but in the latter case the number of seconds may not exceed 2592000 (30 days).persist_to
- (default 0): Ensure this operation is persisted to this many nodes.
- replicate_to (default 0): Ensure this operation is replicated to this many nodes.
- callback(err, cas)
- cas: object with keys and respective CAS token.