⚑$unset

Name
Usage Type
Description

$unset

Object

$unset Operator Sets Specified Values ​​Equal to null.

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

(async () => {

await model.findOneAndUpdate({ name: "Test" },{ $unset:{ name: null } });
/*
The "name" value that was Test is now null
*/

})();

Last updated