I am reading the docs for mongodb here, I am not able to understand these two commands and the different between them.
db.users.find( { finished: { $elemMatch: { $gt: 15, $lt: 20 } } } )
My Understanding : At least one element needs to satisfy both the conditions together.
and
Combination of Elements Satisfies the Criteria ...one element can satisfy the greater than 15 condition and another element can satisfy the less than 20 condition, or a single element can satisfy both
db.users.find( { finished: { $gt: 15, $lt: 20 } } )
Question : How range matching on arrays happen?
Is it like if one element satisfies $gt:15
, this condition is used up and other elements are check for the rest conditions i.e. $lt:20
?