Forrest logo
back to context overview

mongoexport

List of commands for mongoexport:

  • mongoexport:help mongoexport: Display help.
    $ mongoexport --help
    try on your machine
    explain this command
  • mongoexport:tldr:4329d mongoexport: Export a collection to `stdout`, formatted as JSON.
    $ mongoexport --uri=${connection_string} --collection=${collection_name}
    try on your machine
    explain this command
  • mongoexport:tldr:4f3ae mongoexport: Export documents that match the query in the specified file to a CSV file, omitting the list of field names on the first line.
    $ mongoexport --collection=${collection_name} --type=${csv} --fields="${field1,field2,---}" --queryFile=${filename} --noHeaderLine --out=${filename-csv}
    try on your machine
    explain this command
  • mongoexport:tldr:5178f mongoexport: Export documents as a JSON array instead of one object per line.
    $ mongoexport --collection=${collection_name} --jsonArray
    try on your machine
    explain this command
  • mongoexport:tldr:aacdc mongoexport: Export the documents in the specified collection that match a query to a JSON file.
    $ mongoexport --db=${database_name} --collection=${collection_name} --query="${query_object}" --out=${filename-json}
    try on your machine
    explain this command
  • mongoexport:tldr:b0df1 mongoexport: Export documents to a CSV file.
    $ mongoexport --collection=${collection_name} --type=${csv} --fields="${field1,field2,---}" --out=${filename-csv}
    try on your machine
    explain this command
  • mongoexport:tldr:e23ae mongoexport: Export documents to `stdout`, formatted as human-readable JSON.
    $ mongoexport --uri=${mongodb_uri} --collection=${collection_name} --pretty
    try on your machine
    explain this command
back to context overview