My question is about the way MongoDB operates when querying MultiKey document.
Assuming I have these documents:
{
a: 1,
b: 2,
c: ['x','y','z']
},
{
a:3,
b: null,
c: ['x','z']
}
My query is this:
db.<collection>.find({ b: null, c: 'x'})
And my index is:
db.<collection>.ensureIndex({ c: 1 })
My question is: For the query above (that asks for c
AND b
), how does MongoDB invokes the query? Does it 'see' that I have an index on c
or does it try to only look for an index for both c
AND b
?