Specifying a field selector that contains fields within arrays when calling the mongoexport utility has unexpected behaviour, at least when exporting to CSV.
E.g. You have the following document in your db:
{"id_": "username1",
"telephones":
[
,
{"type": "landline", "value": 202020}]
}
Running the following doesn't return the expected results:
mongoexport --csv -f '_id,telephones[0].value,telephones[1].value'