Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (75 sloc) 1.73 KB
.TH MONGOEXPORT "1" "June 2009" "10gen" "Mongo Database"
mongoexport \- the Mongo export tool
\fBmongoexport [\fIOPTIONS\fR]\fR
is a tool to export a MongoDB collection to either JSON or CSV. The query can be filtered or a list of fields to output can be given.
If the output is CSV, the fields must be specified in order.
.B mongoexport -d test -c test1 --csv -f "name,num"
export documents from test.test1 in CSV format
.B \-\-help
show usage information
.B \-\-version
show version information
.B \-v, \-\-verbose
be more verbose (include multiple times for more verbosity
e.g. \-vvvvv)
.B \-h, \-\-host HOST
server to connect to (default HOST=localhost)
.B\-\-port arg
server port. Can also use \-\-host hostname:port
.B \-\-ipv6
enable IPv6 support (disabled by default)
.B \-u|\-\-username USERNAME
specify user to log in as
.B \-p|\-\-password PASSWORD
specify password of user
.B \-\-dbpath PATH
directly access mongod data files in this path, instead of connecting to a mongod instance
.B \-\-directoryperdb
if dbpath specified, each db is in a separate directory
.B \-d, \-\-db DATABASE
database to use
.B \-c, \-\-c COLLECTION
collection to use
.B \-f, \-\-fields FIELDS
comma\-separated list of field names
.B \-\-fieldFile FILE
file with fields names \- 1 per line
.B \-\-query
JSON query filter
.B \-\-csv
export to CSV instead of JSON
.B \-o, \-\-out FILE
output file, if not specified, stdout is used
Copyright 2007\-2011 10gen
For more information, please refer to the MongoDB wiki, available at
Kristina Chodorow
Something went wrong with that request. Please try again.