Answers for "how to set entire array field to empty in mongodb"

15

mongodb query to check empty array

collection.find({ arrayElementName: { $exists: true, $not: {$size: 0} } })
Posted by: Guest on May-03-2020
1

mongodb empty an array field

db.collection.update({}, { $set : {'myArray': [] }} , {multi:true} )
Posted by: Guest on December-16-2020

Code answers related to "how to set entire array field to empty in mongodb"

Code answers related to "Javascript"

Browse Popular Code Answers by Language