将mongodb收集数据提取到节点js中的csv

请find我collections的文件结构:

{ "_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" } 

我想打印所有嵌套的属性显示在列中。 但是我不能这样做,请你帮忙。

将嵌套的选项值设置为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.