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

/jsonpatch-to-mongodb/

    Package Sidebar

    Install

    npm i jsonpatch-to-mongodb

    Weekly Downloads

    2,026

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.82 kB

    Total Files

    4

    Last publish

    Collaborators

    • mongodb-js-user
    • rueckstiess
    • durran
    • alexander_schroll
    • mabaasit
    • 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
    • mongo-j
    • orechova
    • himanshusinghs
    • c-buckingham
    • nbbeeken
    • dbx-node
    • nirinchev
    • pearsb1
    • imlucas