Reputation: 1009
I want to export collection in mongodb using shell command: I try the following command but fields with ":" (number:phone, number:fax) are not exported.
mongoexport --csv -d schemaName -c collectionName -q "{typeName:'user'}" -f "name, surname, e-mail, number:phone, number:fax" -o export.csv
Upvotes: 2
Views: 1215
Reputation: 45307
I think that you have found a legitimate bug. The mongoexport
tool is rarely used and the colon means something very specific when parsing JSON, so the tool is probably confused.
You can file the bug here: http://jira.mongodb.org/
Upvotes: 2