Convert JSON patches into a MongoDB update.
var toMongodb = require('jsonpatch-to-mongodb');
var patches = [{
op: 'replace',
path: '/name',
value: 'dave'
}];
console.log(toMongodb(patches));
// {'$set': {name: 'dave'}};
Example: with express and mongoose
npm install --save jsonpatch-to-mongodb
npm test
MIT