$dec
Object
$dec Operator Performs Extraction as Addition to Number Type Data.
/* Example Usage */ const model = ...Someone Model (async () => { await model.findOneAndUpdate({ name: "Test", age: 20 },{ $dec:{ age: 2 } }); /* The "age" value that was 20 is now 18 */ })();
Last updated 9 months ago