mongodb - Using mongoexport/mongoimport to export in csv format for embeded documents -
how export embeded documents in csv formats.
i use command non-embeded documents:
mongoexport --db db_name -c collection_name --csv -f "field1,field2"
but how embeded documents. suppose collection_name document has embeded_doc embeded in it.
you can still use same syntax:
if have document field name document, such name: { first: "kay" }, can still do:
mongoexport --db db_name -c collection_name --csv -f "name" if want export field first in embedded document name
mongoexport --db db_name -c collection_name --csv -f "name.first"
Comments
Post a Comment