Given documents like the one below, I'd like to return _id only if all elements of the input_array matches the list of available objects. For these examples, the first object should match while the second does not because key3 in first element is "P" instead of "c" and key2 for second element cannot be found in the second lookup object.
{
_id: ObjectId('abcd1234001'),
input_array: [
{
"key1": "a",
"key2": "b",
},
{
"key1": "x"
}
]
},
{
_id: ObjectId('abcd1234002'),
input_array: [
{
"key1": "a",
"key2": "b",
"key3": "P",
},
{
"key1": "x",
"key2": "y",
}
]
}
list of available objects are:
[
{
"key1": "a",
"key2": "b",
"key3": "c",
},
{
"key1": "x"
}
]