I have a collection with elements like this:
{
name: "Smith",
fields: [10, 20, 30]
}
Is there a way to select documents where second value of fields array ( fields[1]) > 15 ?
One solution is:
//create multikey index on field
db.test.createIndex({"fields.1" : 1})
db.test.find({"fields.1" : {$gt : 15}})