MongoDBWriter to update some fields

Hi,

I have created a graph to update some fields of a mongoDB colllection. But while using MongoDBWriter it is updating the entire object instead of updating the particular field. Do I miss any settings/attribute to set.

Also while updating an array element , it should append to the existing array.

Thanks in advance!!!

Hi Micky,

You probably miss “set” operator in your newValue property. Something like:

$out.0.collection = "dogs";
$out.0.query = '{ "_id" : { "$oid" : "5464b3d0aad8b71e2c2bc65f"} }';
$out.0.newValue = '{ $set:{ "dogName": "Frankie" }}';

You can find more information in MongoDB documentation.

Hope this helps.