2022-04-08

MongoDB - Match based on multiple keys of an array of objects

 db.collection_name.aggregate([

    {$match: {

        "array_of_objects": {

            $elemMatch: {

                "object_property_1": value_1,

                "object_property_2": value_2

            }

        }

    }},

]);


No comments:

Post a Comment