Does node.js SDK support update document's attribute without overwrite the other unchanged attribute?


#1

The Replace and Upsert api all ease the old record and cover with the new data.
Is there a api way to just change the properties from the new data, like:

update({fname:'chopper,lname:‘lee’},{fname:‘Jim’}) => {fname:‘Jim’,lname:‘lee’}

For now, i only can copy the origin object, update it with new porperties, then store back to the database.


#2

Hey ChopperLee,

The best way to do this would be to fetch the full document and use CAS to replace individual fields and upsert the document back. Making changes to individual fields is not currently possible, though this is a planned feature.

Cheers, Brett