$pullAll

NameUsage TypeDescription

$pullAll

Object

$pullAll Operator is Used to Pull to Array Type Data, But Type Is Array

/* Example Usage */
const model = ...Someone Model

(async () => {

await model.findOneAndUpdate({ name: "Test", age: 20, arr: ["test","test123"] },{ $pushAll:{ arr:["test","test123"] } });
/*
The "arr" value that was ["test","test123"] is now []
*/

})();

Last updated