how use mongoexport to export only specific fields in a sub-document
what kind of error do you get using dotnotation? I'm running mongoDB 1.8.2 and for me the following works:
mongoexport -d dbName -c collectionName -f subDoc1.subField2 --csv -o /path/to/file.csv
The CSV looks like this
subDoc1.subField2 #header with field names
"subValue2" #actual entry
mongoexport --db db_name --collection collection_name --fields 'No,Name' --out collection_name.json
{"_id":{"$oid":"5b2a1d540e63356357cbff46"},"name":"vijil","dep":"MCA"} {"_id":{"$oid":"5b2a1d5e0e63356357cbff47"},"name":"arul","dep":"MCA"} {"_id":{"$oid":"5b2a1d670e63356357cbff48"},"name":"abessh","dep":"MCA"}