MONGOIMPORT(1)

NAME
mongoimport - the Mongo import tool

SYNOPSIS
mongoimport [OPTIONS]

DESCRIPTION

mongoimport 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.

OPTIONS

--help
    show usage information

--version
    show version information

-v, --verbose
    be more verbose (include multiple times for more verbosity e.g. -vvvvv)

-h, --host HOST
    server to connect to (default HOST=localhost)

server port. Can also use --host hostname:port

--ipv6
    enable IPv6 support (disabled by default)

-u|--username USERNAME
    specify user to log in as

-p|--password PASSWORD
    specify password of user

--dbpath PATH
    directly access mongod data files in this path, instead of connecting to a mongod instance

--directoryperdb
    if dbpath specified, each db is in a separate directory

-d, --db DATABASE
    database to use

-c, --c COLLECTION
    collection to use

-f, --fields FIELDS
    comma-separated list of field names

--fieldFile FILE
    file with fields names - 1 per line

--ignoreBlanks
    if given, empty fields in csv and tsv will be ignored

--type TYPE
    type of file to import. default: json (json,csv,tsv)

--file FILE
    file to import from; if not specified stdin is used

--drop
    drop collection first

--headerline
    CSV,TSV only - use first line as headers

--upsert
    insert or update objects that already exist

--upsertFields ARG
    comma-separated fields for the query part of the upsert. You should make sure this is indexed

--stopOnError
    stop importing at first error rather than continuing

--jsonArray
    load a json array, not one item per line. Currently limited to 16MB.

COPYRIGHT

Copyright 2007-2011 10gen

SEE ALSO
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.

AUTHOR
Kristina Chodorow