/* Example Usage */constmodel=...Someone Model(async () => {awaitmodel.findOneAndUpdate({ name:"Test", age:20, arr: ["test"] },{ $pull:{ arr:["test"] } });// Or Other Usageawait model.findOneAndUpdate({ name: "Test", age: 20, arr: ["test"] },{ $pull:{ arr: function(data) { return data == "test" } } });
/*The "arr" value that was ["test"] is now []If you want to withdraw all the same values, use $multiPull:true in the Option Section*/})();