MongoDB get SubDocument
问题 I would like to retrieve a sub document from a document in MongoDB. I have the following document: { "_id" : "10000", "password" : "password1", "name" : "customer1", "enabled" : true, "channels" : [ { "id" : "10000-1", "name" : "cust1chan1", "enabled" : true }, { "id" : "10000-2", "name" : "cust1chan2", "enabled" : true } ] } The result I would like is: { "id" : "10000-1", "name" : "cust1chan1", "enabled" : true } However, the best I can do so far is using the following query: db.customer