💾 Archived View for freeshell.de › tldr › mongoexport.gmi captured on 2022-06-11 at 22:12:43. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-04-28)
-=-=-=-=-=-=-
Produce exports of data stored in a MongoDB instance formatted as JSON or CSV.
mongoexport --uri={connection_string} --collection={collection_name}
mongoexport --db={database_name} --collection={collection_name} --query="{query_object}" --out={path/to/file.json}
mongoexport --collection={collection_name} --jsonArray
mongoexport --collection={collection_name} --type={csv} --fields="{field1,field2,...}" --out={path/to/file.csv}
mongoexport --collection={collection_name} --type={csv} --fields="{field1,field2,...}" --queryFile={path/to/file} --noHeaderLine --out={path/to/file.csv}
mongoexport --uri={mongodb_uri} --collection={collection_name} --pretty
mongoexport --help
Copyright © 2014—present the tldr-pages team and contributors.
This work is licensed under the Creative Commons Attribution 4.0 International License (CC-BY).