Features
- supported operators: $inc, $set, $unset, $push, $pushAll, $addToSet, $each, $pop, $pull, $pullAll, $rename, $bit
Examples
var fiddle = ; //increment age by onevar fiddled = ; //{ name: "Craig", age: 22 } //check if the age is less than 22 before modifyingfiddled = ; //{ name: "Craig", age: 22 } //return a function insteadvar fiddler = ; //modify it; //{ name: "Joe", n: 1} //modify multiple
Filter Example
var fiddle = ; var fiddler = ; //result: {name:"Craig",age:22, n:1}, {name:"Tim",age:21,n:1};
API
.fiddle(modifiers[, filter][, targets])
modifiers
- the modifiers against the given target / targetsfilter
- the optional filter to check against the targets. Can be mongodb expression, regexp, or functiontargets
- the target / targets to modify