Mongodb multi nested array search
问题 My aim is to search records of data userid 1 Below is my data { "_id" : 2, "name" : "test", "data" :[{"_id" : "1","file" : "nic", "userid" : [1,2 ]}, {"_id" : "2","file" : "nic1","userid" : [1 ] }, {"_id" : 3,"file" : "nick2","userid" : [1,2 ]} ]}, { "_id" : 3, "name" : "test", "data" : [{"_id" : "1","file" : "nic","userid" : [1,2 ] }, {"_id" : "2","file" : "nic1", "userid" : [3,2 ] } ]} out put should be { "_id" : 2, "name" : "test", "data" :[{"_id" : "1","file" : "nic", "userid" : [1,2 ]},