2016-03-29 71 views
1

請找我收藏的文檔結構:MongoDB中收集的數據取到CSV的節點JS

{ 
"_id": "9759572745-Sing", 
"details": { 
"Gender": "M", 
"PreTrainingStatus": "Fresher", 
"Religion": "Hindu", 
"attendanceInPercentage": "", 
"batchHolders": { 
    "AssessmentDate": "Thu Jul 16 2015", 
    "CourseFee": "7500", 
    "isEditable": false 
}, 
"batchID": "282726", 
"eid": "", 
"whereDidYouHearAboutStar": "---Select---", 
"skillInstructorOrTrainerName": "282726", 
"specificGovtInstitutetieups": "---Select---", 
"isSelected": false, 
"isEditable": false 
}, 
"addedOnMs": 1439455766000, 
"submittedOnMs": 1439454813000, 
"latitude": "27.409566879272", 
"longitude": "77.69295501709", 
"locationName": "Uttar Pradesh 281006,null" 
} 

我想打印的所有嵌套的屬性顯示在列。但我無法這樣做,請你幫忙。

回答

1

組嵌套期權價值爲true

Specify fields that you want from JSON. 
For nested document you can specify like this batchHolders.AssessmentDate (it will give you "Thu Jul 16 2015") and so on for others also. 
+0

太謝謝你了 –