From:http://stackoverflow.com/questions/12629692/querying-an-array-of-arrays-in-mongodb
Data
Db.multiArr.insert ({"id": "fruit1", "Keys": [["Apple", "carrot", "banana"]]}) Db.multiArr.insert ({"id": "Fruit2", " Keys ": [[" Apple "," orange "," Banana "]]}) db.multiArr.find ({' Keys ': {$elemMatch: {$elemMatch: {$in: [' Carrot '}}}}) {" _ ID ": ObjectId (" 506555212AEB79B5F7374CBF ")," id ":" fruit1 "," Keys ": [[" Apple "," carrot "," banana "]]}db.multiarr.fin D ({' Keys ': {$elemMatch: {$elemMatch: {$in: [' Banana '}}}}}} {"_id": ObjectId ("506555212AEB79B5F7374CBF"), "id": "fruit1 "," Keys ": [[" Apple "," carrot "," banana "]]} {" _id ": ObjectId (" 5065587e2aeb79b5f7374cc0 ")," id ":" fruit2 "," Keys ": [["Apple", "orange", "Banana"]]}
Query statement:
Interesting question, this would do the trick
Db.multiArr.find ({' Keys ': {$elemMatch: {$elemMatch: {$in: [' Carrot '}}}})
$elemMatch used to check if a element in an array matches the specified match expression. So nested $elemMatch would go deeper into nested arrays
"MongoDB" Nested arrays query scheme