if i have in mongodb a array structure like this:
"field":
[
[10,20] //specified length per array
[25,40]
[60,90]
...and so on, with various size per document
]
how can i index this subarrays? i tried to index with: db.ensureIndex({"field.$.0":1}); //and {"field.$.1":1}
but searching in documents is remained slow.
I tried also this solution: MongoDB, array of arrays index but
db.ensureIndex("{field:[{"a":1}]}"); //and "{field:[{"b":1}]}"
if a naming the subarray indexes a and b, this sintax throws "bad index key pattern" exception.