jsonpatch-to-mongodb
Convert JSON patches into a MongoDB update
Last updated 9 months ago by imlucas .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jsonpatch-to-mongodb 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (9 months ago)

6 Versions

  • 1.0.0                                ...           9 months ago
  • 0.4.0                                ...           3 years ago
  • 0.3.0                                ...           4 years ago
  • 0.2.0                                ...           6 years ago
  • 0.1.1                                ...           6 years ago
  • 0.1.0                                ...           6 years ago

Copyright 2014 - 2016 © taobao.org |