Mongoexport - fields --csv will only display the first field when working with subdocuments

IN:

.\mongoexport.exe --db mydb --collection slideproof_user_event_date_count --csv --out events.csv --fields '_id,first_day' .\mongoexport.exe --db mydb --collection slideproof_user_event_date_count --out events.json --fields '_id._p,first_day' 

Doesn't work (only the first field / column contains content):

  .\mongoexport.exe --db mydb --collection slideproof_user_event_date_count --csv --out events.csv --fields '_id._p, first_day' 

How to enable correct output for .csv with margin fields?

+7
mongodb
source share
1 answer

The solution is to avoid spaces in the -fields argument:

it works:

 --fields '_id._p,value.count' 

It does not mean:

 --fields '_id._p, value.count' 
+17
source share

All Articles