2022-03-27

MongoDB - Filter documents where a given field is NOT an array

 db.collection.aggregate([

    {$match: {

         $expr: { $ne: [ {$isArray: "$field_to_check"}, true] }

    }}

]);   

No comments:

Post a Comment