Skip to content

bitgorust/jsonpatch-to-mongodb

 
 

Repository files navigation

jsonpatch-to-mongodb

build status

Convert JSON patches into a MongoDB update.

Example

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

Install

npm install --save jsonpatch-to-mongodb

Test

npm test

License

MIT

About

Convert JSON patches into a MongoDB update

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%