mongoexport --fields --csv will only output the first field when working with subdocuments mongoexport --fields --csv will only output the first field when working with subdocuments mongodb mongodb

mongoexport --fields --csv will only output the first field when working with subdocuments


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

this works:

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

This does not:

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