0.1.5 • Published 12 years ago

mupdate v0.1.5

Weekly downloads
27
License
-
Repository
github
Last release
12 years ago

mupdate

A NodeJS library which can parse Mongo update modifier command and apply them to local objects. For example,

var mupdate = require('mupdate')
var local = {
    'foo': 'bar',
    'nesting': {
        'keys': 'so',
        'I': ['can', 'use'],
        'dot': {
            'syntax': 'like a boss',
        },
    },
};

var update = {
    '$set': {
        'foo':'bar none',
    },
    '$push': {
        'nesting.I': 'pithy',
    },
}

// mupdate.update updates the original in-place and returns it with changes
// applied.
console.log(mupdate.update(local, update));
console.log('===');
console.log(local);
0.1.5

12 years ago

0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago