Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

93 lines (92 sloc) 2.25 kB
.TH MONGOIMPORT "1" "January 2010" "10gen" "Mongo Database"
mongoimport \- the Mongo import tool
\fBmongoimport [\fIOPTIONS\fR]\fR
is a tool to import a MongoDB collection from JSON, CSV, or TSV. The query can be filtered or a list of fields to input can be given.
.\".B mongoimport -d test -c test1 --csv -f "name,num"
.\"import 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 \-\-ignoreBlanks
if given, empty fields in csv and tsv will be ignored
.B \-\-type TYPE
type of file to import. default: json (json,csv,tsv)
.B \-\-file FILE
file to import from; if not specified stdin is used
.B \-\-drop
drop collection first
.B \-\-headerline
CSV,TSV only \- use first line as headers
.B \-\-upsert
insert or update objects that already exist
.B \-\-upsertFields ARG
comma-separated fields for the query part of the upsert. You should
make sure this is indexed
.B \-\-stopOnError
stop importing at first error rather than continuing
.B \-\-jsonArray
load a json array, not one item per line. Currently limited to 4MB.
Copyright 2007\-2011 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.