I have a collection test with a record :
[{ number:"1524",
name:null,
cat_id:"126842"},
{number:"456",
name:null,
cat_id:null }]
How to remove the whole row having null values like this :
[{ number:"1524",
cat_id:"126842" },
{ number:"456"}]
I tried this but whole records are getting deleted rather than just the rows.
collection.deleteMany( { $or: [{cat_id : null },{ name : null }]
Need to remove multiple variables in a single query.
MongoDB version 4.0