Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (51 sloc) 1.291 kb
.\" Documentation for the MongoDB shell
.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 \-h, \-\-host HOST
server to connect to (default HOST=localhost)
.B \-d, \-\-db DATABASE
database to use
.B \-c, \-\-c COLLECTION
collection to use
.B \-q, \-\-query QUERY
query filter
.B \-f, \-\-fields FIELDS
comma\-separated list of field names
.B \-\-csv
export to CSV instead of JSON
.B \-o, \-\-out FILE
output file, if not specified, stdout is used
.B \-\-dbpath PATH
directly access mongod data files in this path, instead of connecting to a mongod instance
Copyright 2007\-2009 10gen
For more information, please refer to the MongoDB wiki, available at
Kristina Chodorow
Jump to Line
Something went wrong with that request. Please try again.