For update.js to work, I had to add JSON.parse() or the object would never turn into JS properties. update.$inc etc. would not be present. Once JSON parameter is parsed it worked great!
if (!update) throw new Error("The update is undefined or null.");
update = JSON.parse(update); // convert JSON string to object
For update.js to work, I had to add
JSON.parse()
or the object would never turn into JS properties.update.$inc
etc. would not be present. Once JSON parameter is parsed it worked great!Sample Increment HTTP Request Body...
["foo", "{\"$inc\":{\"counter\":1}}"]