2010-01-25 22:10:18 +01:00
|
|
|
.TH MONGOIMPORT "1" "January 2010" "10gen" "Mongo Database"
|
|
|
|
.SH "NAME"
|
|
|
|
mongoimport \- the Mongo import tool
|
|
|
|
.SH "SYNOPSIS"
|
|
|
|
\fBmongoimport [\fIOPTIONS\fR]\fR
|
|
|
|
.SH "DESCRIPTION"
|
|
|
|
.PP
|
|
|
|
\fBmongoimport\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.
|
|
|
|
.\".SH "EXAMPLES"
|
|
|
|
.\".TP
|
|
|
|
.\".B mongoimport -d test -c test1 --csv -f "name,num"
|
|
|
|
.\"import documents from test.test1 in CSV format
|
2011-03-17 19:56:03 +01:00
|
|
|
.SH "OPTIONS"
|
2010-01-25 22:10:18 +01:00
|
|
|
.TP
|
2011-03-17 19:56:03 +01:00
|
|
|
.B \-\-help
|
2010-01-25 22:10:18 +01:00
|
|
|
show usage information
|
|
|
|
.TP
|
2011-03-17 20:37:47 +01:00
|
|
|
.B \-\-version
|
|
|
|
show version information
|
|
|
|
.TP
|
2011-03-17 19:56:03 +01:00
|
|
|
.B \-v, \-\-verbose
|
|
|
|
be more verbose (include multiple times for more verbosity
|
|
|
|
e.g. \-vvvvv)
|
|
|
|
.TP
|
2010-01-25 22:10:18 +01:00
|
|
|
.B \-h, \-\-host HOST
|
|
|
|
server to connect to (default HOST=localhost)
|
|
|
|
.TP
|
2011-03-17 19:56:03 +01:00
|
|
|
.B\-\-port arg
|
|
|
|
server port. Can also use \-\-host hostname:port
|
2010-01-25 22:10:18 +01:00
|
|
|
.TP
|
2011-03-17 19:56:03 +01:00
|
|
|
.B \-\-ipv6
|
|
|
|
enable IPv6 support (disabled by default)
|
|
|
|
.TP
|
|
|
|
.B \-u|\-\-username USERNAME
|
|
|
|
specify user to log in as
|
|
|
|
.TP
|
|
|
|
.B \-p|\-\-password PASSWORD
|
|
|
|
specify password of user
|
2010-01-25 22:10:18 +01:00
|
|
|
.TP
|
|
|
|
.B \-\-dbpath PATH
|
2011-03-17 19:56:03 +01:00
|
|
|
directly access mongod data files in this path, instead of connecting to a mongod instance
|
2010-01-25 22:10:18 +01:00
|
|
|
.TP
|
2011-03-17 19:56:03 +01:00
|
|
|
.B \-\-directoryperdb
|
|
|
|
if dbpath specified, each db is in a separate directory
|
2010-01-25 22:10:18 +01:00
|
|
|
.TP
|
2011-03-17 19:56:03 +01:00
|
|
|
.B \-d, \-\-db DATABASE
|
|
|
|
database to use
|
|
|
|
.TP
|
|
|
|
.B \-c, \-\-c COLLECTION
|
|
|
|
collection to use
|
|
|
|
.TP
|
|
|
|
.B \-f, \-\-fields FIELDS
|
|
|
|
comma\-separated list of field names
|
2010-01-25 22:10:18 +01:00
|
|
|
.TP
|
|
|
|
.B \-\-fieldFile FILE
|
|
|
|
file with fields names \- 1 per line
|
|
|
|
.TP
|
|
|
|
.B \-\-ignoreBlanks
|
|
|
|
if given, empty fields in csv and tsv will be ignored
|
|
|
|
.TP
|
|
|
|
.B \-\-type TYPE
|
|
|
|
type of file to import. default: json (json,csv,tsv)
|
|
|
|
.TP
|
|
|
|
.B \-\-file FILE
|
|
|
|
file to import from; if not specified stdin is used
|
|
|
|
.TP
|
|
|
|
.B \-\-drop
|
|
|
|
drop collection first
|
|
|
|
.TP
|
|
|
|
.B \-\-headerline
|
|
|
|
CSV,TSV only \- use first line as headers
|
2011-03-17 19:56:03 +01:00
|
|
|
.TP
|
|
|
|
.B \-\-upsert
|
|
|
|
insert or update objects that already exist
|
|
|
|
.TP
|
|
|
|
.B \-\-upsertFields ARG
|
|
|
|
comma-separated fields for the query part of the upsert. You should
|
|
|
|
make sure this is indexed
|
|
|
|
.TP
|
|
|
|
.B \-\-stopOnError
|
|
|
|
stop importing at first error rather than continuing
|
|
|
|
.TP
|
|
|
|
.B \-\-jsonArray
|
|
|
|
load a json array, not one item per line. Currently limited to 4MB.
|
2010-01-25 22:10:18 +01:00
|
|
|
.SH "COPYRIGHT"
|
|
|
|
.PP
|
2011-03-17 19:56:03 +01:00
|
|
|
Copyright 2007\-2011 10gen
|
2010-01-25 22:10:18 +01:00
|
|
|
.SH "SEE ALSO"
|
|
|
|
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
|
|
|
|
.SH "AUTHOR"
|
|
|
|
Kristina Chodorow
|