Not sure how to query for matching directory_object_ids for a mongo db object with the follow structure.
"_id" : ObjectId("5702e52e51c2e40f55b3fd43"),
"_revision" : 4,
"enabled" : true,
"selector" : {
"directory_object_ids" : [
ObjectId("56c4bfb793e0be0eb6297369"),
ObjectId("56c4bfc293e0be0eb6297391"),
ObjectId("56cdfc65f2325d0e6346b7fe")
]
}
I've tried
db.policies.find({"selector":{"directory_object_ids":{$elemMatch: {$eq:ObjectId("56cdfc65f2325d0e6346b7fe")}}}}).pretty()
and
db.policies.find({"selector":{"directory_object_ids": {$eq:ObjectId("56cdfc65f2325d0e6346b7fe")}}}).pretty()
with no luck.
Thank you in advance.