I have simple query that results with array:
db.getCollection('myCollection')
.find( {
_id: '5c1286ed222a6e0e4acbd018'
},
{
myProperty: 1,
_id: 0
})
Result:
{
"myProperty" : [
"5c1286ed222a6e0e4acbd017"
]
}
I want to query another collection with this result. The other collection (let call it yourCollection) has property 'yourProperty' which is the same kind of array like the result.
db.getCollection('scene').find({
// all the objects where 'yourProperty' contains at least one element of
// the first query result.
'yourProperty': containsAny() //Something like that
})
My goal is to get all elements of 'yourCollection' where its property 'yourProperty' has at least one element that is resulted with first query above.