1MONGOIMPORT(1) Mongo Database MONGOIMPORT(1)
2
3
4
6 mongoimport - the Mongo import tool
7
9 mongoimport [OPTIONS]
10
12 mongoimport is a tool to import a MongoDB collection from JSON, CSV, or
13 TSV. The query can be filtered or a list of fields to input can be
14 given.
15
16 OPTIONS
17 --help show usage information
18
19 -h, --host HOST
20 server to connect to (default HOST=localhost)
21
22 -d, --db DATABASE
23 database to use
24
25 -c, --c COLLECTION
26 collection to use (some commands)
27
28 --dbpath PATH
29 directly access mongod data files in this path, instead of con‐
30 necting to a mongod instance
31
32 -v, --verbose
33 be more verbose (include multiple times for more verbosity e.g.
34 -vvvvv)
35
36 -f, --fields NAMES
37 comma seperated list of field names e.g. -f name,age
38
39 --fieldFile FILE
40 file with fields names - 1 per line
41
42 --ignoreBlanks
43 if given, empty fields in csv and tsv will be ignored
44
45 --type TYPE
46 type of file to import. default: json (json,csv,tsv)
47
48 --file FILE
49 file to import from; if not specified stdin is used
50
51 --drop drop collection first
52
53 --headerline
54 CSV,TSV only - use first line as headers
55
57 Copyright 2007-2009 10gen
58
60 For more information, please refer to the MongoDB wiki, available at
61 http://www.mongodb.org.
62
64 Kristina Chodorow
65
66
67
6810gen January 2010 MONGOIMPORT(1)