2022-04-08

MongoDB - Match based on multiple keys of an array of objects NOT having the given values

 db.collection_name.aggregate([

    {$match: {

        $nor: [

            {"array_of_objects": {

                $elemMatch: {

                    "object_property_1": value_1,

                    "object_property_2": value_2

                }

            }}

        ]

    }},

]);

No comments:

Post a Comment