jsonpatch-to-mongodb

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i jsonpatch-to-mongodb

Weekly Downloads

13,120

Version

1.0.0

License

MIT

Unpacked Size

4.82 kB

Total Files

4

Last publish

Collaborators

  • orechova
  • himanshusinghs
  • c-buckingham
  • mongo-j
  • mabaasit
  • alexander_schroll
  • chuck.kalmanek
  • mongodb-js-user
  • rueckstiess
  • durran
  • lerouxb
  • fredtruman
  • mbroadst
  • hswolff
  • satyasinha
  • matt_d_rat
  • rhysm
  • tomhollander
  • alena.khineika
  • jeff-allen-mongo
  • mmarcon
  • jonathan.balsano
  • mongodb-build
  • jack.weir
  • stennie
  • mcasimir
  • kristina.stefano
  • jarjee
  • shaketbaby
  • devtoolsbot
  • addaleax
  • gribnoysup
  • mutukrish
  • imlucas