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

2,644

Version

1.0.0

License

MIT

Unpacked Size

4.82 kB

Total Files

4

Last publish

Collaborators

  • dbx-node
  • nbbeeken
  • orechova
  • himanshusinghs
  • c-buckingham
  • mongo-j
  • mabaasit
  • alexander_schroll
  • 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
  • mcasimir
  • kristina.stefano
  • jarjee
  • shaketbaby
  • devtoolsbot
  • addaleax
  • gribnoysup
  • mutukrish
  • imlucas