How to get all documents with a find query where the queried array fields are exists in the document?
{
name: 'test1',
"array": [
{
"name": "100",
"subArray": [
"arr1"
]
},
{
"name": "200",
"subArray": [
"arr2",
"arr3"
]
}
]
}
If i use this query in the find({}) it gives back not only the good results:
$and: [
{'array.name': '100'}, {'array.subArray': 'arr1'},
{'array.name': '200'}, {'array.subArray': 'arr2'}
]