This is the document model:
{
foo: {
bar: 1
},
some_array: [
{
xyz: 1
},
{
xyz: 2
}
]
},
{
foo: {
bar: 2
},
some_array: [
{
xyz: 123
},
{
xyz: 321
}
]
}
I want to find the documents that 'foo.bar' equals to 'some_array.xyz'.
As the example, only the first document should be fetched.
How to do it?