2012-10-29 106 views
0

返回嵌套值我有以下的數據結構,其中Question.findOne()回報:搜索和MongoDB中

Object 
_id: "8132c2f0-baee-434f-a739-c4d30718daf2" 
owner: "273b7291-df2b-494c-bd9b-64e71283447e" 
question: "Vacations?" 
answers: Array[1] 
    0: Object 
    name: "Cancun" 
    owned_by: "273b7291-df2b-494c-bd9b-64e71283447e" 
    __proto__: Object 

我怎樣才能findreturn答案使用MongoDB的具有_id "8132c2f0-baee-434f-a739-c4d30718daf2"這個文件的數組?這裏是我已經開始:

Questions.find({}, {"answers.name":1}) 

回答