~evarlast/ubuntu/trusty/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to debian/manpages/mongoimport.1

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.37.1.
2
 
.TH MONGOIMPORT "1" "January 2010" "10gen" "Mongo Database"
3
 
.SH "NAME"
4
 
mongoimport \- the Mongo import tool
5
 
.SH "SYNOPSIS"
6
 
\fBmongoimport [\fIOPTIONS\fR]\fR
7
 
.SH "DESCRIPTION"
8
 
.PP
9
 
\fBmongoimport\fR
10
 
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.
11
 
.\".SH "EXAMPLES"
12
 
.\".TP
13
 
.\".B mongoimport -d test -c test1 --csv -f "name,num"
14
 
.\"import documents from test.test1 in CSV format
15
 
.SH "OPTIONS"
 
1
.TH "MONGOIMPORT" "1" "March 14, 2013" "2.2.3" "mongodb-manual"
 
2
.SH NAME
 
3
mongoimport \- MongoDB
 
4
.
 
5
.nr rst2man-indent-level 0
 
6
.
 
7
.de1 rstReportMargin
 
8
\\$1 \\n[an-margin]
 
9
level \\n[rst2man-indent-level]
 
10
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
 
11
-
 
12
\\n[rst2man-indent0]
 
13
\\n[rst2man-indent1]
 
14
\\n[rst2man-indent2]
 
15
..
 
16
.de1 INDENT
 
17
.\" .rstReportMargin pre:
 
18
. RS \\$1
 
19
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
 
20
. nr rst2man-indent-level +1
 
21
.\" .rstReportMargin post:
 
22
..
 
23
.de UNINDENT
 
24
. RE
 
25
.\" indent \\n[an-margin]
 
26
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
 
27
.nr rst2man-indent-level -1
 
28
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
 
29
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
 
30
..
 
31
.\" Man page generated from reStructuredText.
 
32
.
 
33
.SH SYNOPSIS
 
34
.sp
 
35
The \fI\%mongoimport\fP tool provides a route to import content from a
 
36
JSON, CSV, or TSV export created by \fBmongoexport\fP, or
 
37
potentially, another third\-party export tool. See the
 
38
"\fB/administration/import\-export\fP" document for a more in depth
 
39
usage overview, and the "\fBmongoexport\fP" document for more
 
40
information regarding \fBmongoexport\fP, which
 
41
provides the inverse "importing" capability.
 
42
.IP Note
 
43
Do not use \fI\%mongoimport\fP and \fBmongoexport\fP for
 
44
full instance, production backups because they will not reliably capture data type
 
45
information. Use \fBmongodump\fP and \fBmongorestore\fP as
 
46
described in "\fB/administration/backups\fP" for this kind of
 
47
functionality.
 
48
.RE
 
49
.SH OPTIONS
 
50
.INDENT 0.0
 
51
.TP
 
52
.B mongoimport
 
53
.UNINDENT
 
54
.INDENT 0.0
16
55
.TP
17
56
.B \-\-help
18
 
show usage information
 
57
Returns a basic help and usage text.
 
58
.UNINDENT
 
59
.INDENT 0.0
 
60
.TP
 
61
.B \-\-verbose, \-v
 
62
Increases the amount of internal reporting returned on the command
 
63
line. Increase the verbosity with the \fB\-v\fP form by including
 
64
the option multiple times, (e.g. \fB\-vvvvv\fP.)
 
65
.UNINDENT
 
66
.INDENT 0.0
19
67
.TP
20
68
.B \-\-version
21
 
show version information
22
 
.TP
23
 
.B \-v, \-\-verbose
24
 
be more verbose (include multiple times for more verbosity
25
 
e.g. \-vvvvv)
26
 
.TP
27
 
.B \-h, \-\-host HOST
28
 
server to connect to (default HOST=localhost)
29
 
.TP
30
 
.B \-\-port arg
31
 
server port. Can also use \-\-host hostname:port
 
69
Returns the version of the \fI\%mongoimport\fP program.
 
70
.UNINDENT
 
71
.INDENT 0.0
 
72
.TP
 
73
.B \-\-host <hostname><:port>, \-h
 
74
Specifies a resolvable hostname for the \fBmongod\fP to which
 
75
you want to restore the database. By default \fI\%mongoimport\fP
 
76
will attempt to connect to a MongoDB process ruining on the
 
77
localhost port numbered \fB27017\fP.
 
78
.sp
 
79
Optionally, specify a port number to connect a MongoDB instance
 
80
running on a port other than \fB27017\fP.
 
81
.sp
 
82
To connect to a replica set, use the \fI\%--host\fP argument with a
 
83
setname, followed by a slash and a comma\-separated list of host and
 
84
port names. \fI\%mongoimport\fP will, given the seed of at least
 
85
one connected set member, connect to primary node of that set. This
 
86
option would resemble:
 
87
.sp
 
88
.nf
 
89
.ft C
 
90
\-\-host repl0/mongo0.example.net,mongo0.example.net:27018,mongo1.example.net,mongo2.example.net
 
91
.ft P
 
92
.fi
 
93
.sp
 
94
You can always connect directly to a single MongoDB instance by
 
95
specifying the host and port number directly.
 
96
.UNINDENT
 
97
.INDENT 0.0
 
98
.TP
 
99
.B \-\-port <port>
 
100
Specifies the port number, if the MongoDB instance is not running on
 
101
the standard port. (i.e. \fB27017\fP) You may also specify a port
 
102
number using the \fI\%mongoimport --host\fP command.
 
103
.UNINDENT
 
104
.INDENT 0.0
32
105
.TP
33
106
.B \-\-ipv6
34
 
enable IPv6 support (disabled by default)
35
 
.TP
36
 
.B \-u|\-\-username USERNAME
37
 
specify user to log in as
38
 
.TP
39
 
.B \-p|\-\-password PASSWORD
40
 
specify password of user
41
 
.TP
42
 
.B \-\-dbpath PATH
43
 
directly access mongod data files in this path, instead of connecting to a mongod instance
 
107
Enables IPv6 support that allows \fI\%mongoimport\fP to connect
 
108
to the MongoDB instance using an IPv6 network. All MongoDB programs
 
109
and processes, including \fI\%mongoimport\fP, disable IPv6
 
110
support by default.
 
111
.UNINDENT
 
112
.INDENT 0.0
 
113
.TP
 
114
.B \-\-ssl
 
115
New in version 2.4: MongoDB added support for SSL connections to \fBmongod\fP
 
116
instances in mongoimport.
 
117
.IP Note
 
118
SSL support in mongoimport is not compiled into the default
 
119
distribution of MongoDB. See \fB/administration/ssl\fP for more
 
120
information on SSL and MongoDB.
 
121
.sp
 
122
Additionally, mongoimport does not support connections to
 
123
\fBmongod\fP instances that require client certificate
 
124
validation.
 
125
.RE
 
126
.sp
 
127
Allows \fI\%mongoimport\fP to connect to \fBmongod\fP
 
128
instance over an SSL connection.
 
129
.UNINDENT
 
130
.INDENT 0.0
 
131
.TP
 
132
.B \-\-username <username>, \-u <username>
 
133
Specifies a username to authenticate to the MongoDB instance, if your
 
134
database requires authentication. Use in conjunction with the
 
135
\fI\%mongoimport --password\fP option to supply a password.
 
136
.UNINDENT
 
137
.INDENT 0.0
 
138
.TP
 
139
.B \-\-password <password>, \-p <password>
 
140
Specifies a password to authenticate to the MongoDB instance. Use
 
141
in conjunction with the \fI\%mongoimport --username\fP option to
 
142
supply a username.
 
143
.sp
 
144
If you specify a \fI\%--username\fP
 
145
without the \fI\%--password\fP option, \fI\%mongoimport\fP
 
146
will prompt for a password interactively.
 
147
.UNINDENT
 
148
.INDENT 0.0
 
149
.TP
 
150
.B \-\-authenticationDatabase <dbname>
 
151
New in version 2.4.
 
152
.sp
 
153
Specifies the database that holds the user\(aqs (e.g
 
154
\fI\%--username\fP) credentials.
 
155
.sp
 
156
By default, \fI\%mongoimport\fP assumes that the database specified to the
 
157
\fI\%--db\fP argument holds the user\(aqs credentials, unless you
 
158
specify \fI\%--authenticationDatabase\fP.
 
159
.sp
 
160
See \fBuserSource\fP,
 
161
\fB/reference/privilege\-documents\fP and
 
162
\fB/reference/user\-privileges\fP for more information about
 
163
delegated authentication in MongoDB.
 
164
.UNINDENT
 
165
.INDENT 0.0
 
166
.TP
 
167
.B \-\-authenticationMechanism <name>
 
168
New in version 2.4.
 
169
.sp
 
170
Specifies the authentication mechanism. By default, the
 
171
authentication mechanism is \fBMONGODB\-CR\fP, which is the MongoDB
 
172
challenge/response authentication mechanism. In the MongoDB Subscriber Edition,
 
173
\fI\%mongoimport\fP also includes support for \fBGSSAPI\fP to handle
 
174
Kerberos authentication.
 
175
.sp
 
176
See \fB/tutorial/control\-access\-to\-mongodb\-with\-kerberos\-authentication\fP
 
177
for more information about Kerberos authentication.
 
178
.UNINDENT
 
179
.INDENT 0.0
 
180
.TP
 
181
.B \-\-dbpath <path>
 
182
Specifies the directory of the MongoDB data files. If used, the
 
183
\fI\%--dbpath\fP option enables
 
184
\fI\%mongoimport\fP to attach directly to local data files and
 
185
insert the data without the \fBmongod\fP. To run with
 
186
\fB\-\-dbpath\fP, \fI\%mongoimport\fP needs to lock access to the
 
187
data directory: as a result, no \fBmongod\fP can access the
 
188
same path while the process runs.
 
189
.UNINDENT
 
190
.INDENT 0.0
44
191
.TP
45
192
.B \-\-directoryperdb
46
 
if dbpath specified, each db is in a separate directory
47
 
.TP
48
 
.B \-d, \-\-db DATABASE
49
 
database to use
50
 
.TP
51
 
.B \-c, \-\-c COLLECTION
52
 
collection to use
53
 
.TP
54
 
.B \-\-dbpath PATH
55
 
directly access mongod data files in this path,
56
 
instead of connecting to a mongod instance
57
 
.TP
58
 
.B \-v, \-\-verbose
59
 
be more verbose (include multiple times for more
60
 
verbosity e.g. \fB\-vvvvv\fR)
61
 
.TP
62
 
.B \-f, \-\-fields NAMES
63
 
comma separated list of field names e.g. \fB\-f\fR name,age
64
 
.TP
65
 
.B \-\-fieldFile FILE
66
 
file with fields names \- 1 per line
67
 
.TP
68
 
.B \-\-jsonArray
69
 
load a json array, not one item per line. Currently limited to 4MB.
 
193
Use the \fI\%--directoryperdb\fP in conjunction with the
 
194
corresponding option to \fBmongod\fP, which allows
 
195
\fI\%mongoimport\fP to import data into MongoDB instances that
 
196
have every database\(aqs files saved in discrete directories on the
 
197
disk. This option is only relevant when specifying the
 
198
\fI\%--dbpath\fP option.
 
199
.UNINDENT
 
200
.INDENT 0.0
 
201
.TP
 
202
.B \-\-journal
 
203
Allows \fBmongoexport\fP write to the durability
 
204
\fIjournal\fP to ensure that the data files will remain in a
 
205
consistent state during the write process. This option is only
 
206
relevant when specifying the \fI\%--dbpath\fP option.
 
207
.UNINDENT
 
208
.INDENT 0.0
 
209
.TP
 
210
.B \-\-db <db>, \-d <db>
 
211
Use the \fI\%--db\fP option to specify a database for
 
212
\fI\%mongoimport\fP to restore data. If you do not specify a
 
213
\fB<db>\fP, \fI\%mongoimport\fP creates new databases that
 
214
correspond to the databases where data originated and data may be
 
215
overwritten. Use this option to restore data into a MongoDB
 
216
instance that already has data, or to restore only some data in the
 
217
specified backup.
 
218
.UNINDENT
 
219
.INDENT 0.0
 
220
.TP
 
221
.B \-\-collection <collection>, \-c <collection>
 
222
Use the \fI\%--collection\fP option to specify a collection for
 
223
\fBmongorestore\fP to restore. If you do not specify a
 
224
\fB<collection>\fP, \fI\%mongoimport\fP imports all collections
 
225
created. Existing data may be overwritten. Use this option to
 
226
restore data into a MongoDB instance that already has data, or to
 
227
restore only some data in the specified imported data set.
 
228
.UNINDENT
 
229
.INDENT 0.0
 
230
.TP
 
231
.B \-\-fields <field1<,filed2>>, \-f <field1[,filed2]>
 
232
Specify a comma seperatedlist of field names when importing
 
233
\fIcsv\fP or \fItsv\fP files that do not have field names in
 
234
the first (i.e. header) line of the file.
 
235
.UNINDENT
 
236
.INDENT 0.0
 
237
.TP
 
238
.B \-\-fieldFile <filename>
 
239
As an alternative to \fI\%--fields\fP the \fI\%--fieldFile\fP
 
240
option allows you to specify a file (e.g. \fB<file>\(ga\fP) to that
 
241
holds a list of field names if your \fIcsv\fP or \fItsv\fP
 
242
file does not include field names in the first (i.e. header) line
 
243
of the file. Place one field per line.
 
244
.UNINDENT
 
245
.INDENT 0.0
70
246
.TP
71
247
.B \-\-ignoreBlanks
72
 
if given, empty fields in csv and tsv will be ignored
73
 
.TP
74
 
.B \-\-type TYPE
75
 
type of file to import.  default: json (json,csv,tsv)
76
 
.TP
77
 
.B \-\-file FILE
78
 
file to import from; if not specified stdin is used
 
248
In \fIcsv\fP and \fItsv\fP exports, ignore empty fields. If not
 
249
specified, \fI\%mongoimport\fP creates fields without values in
 
250
imported documents.
 
251
.UNINDENT
 
252
.INDENT 0.0
 
253
.TP
 
254
.B \-\-type <json|csv|tsv>
 
255
Declare the type of export format to import. The default format is
 
256
\fIJSON\fP, but it\(aqs possible to import \fIcsv\fP and
 
257
\fItsv\fP files.
 
258
.UNINDENT
 
259
.INDENT 0.0
 
260
.TP
 
261
.B \-\-file <filename>
 
262
Specify the location of a file containing the data to
 
263
import. \fI\%mongoimport\fP will read data from standard input
 
264
(e.g. "stdin.") if you do not specify a file.
 
265
.UNINDENT
 
266
.INDENT 0.0
79
267
.TP
80
268
.B \-\-drop
81
 
drop collection first
 
269
Modifies the importation procedure so that the target instance
 
270
drops every collection before restoring the collection from the
 
271
dumped backup.
 
272
.UNINDENT
 
273
.INDENT 0.0
82
274
.TP
83
275
.B \-\-headerline
84
 
CSV,TSV only \- use first line as headers
 
276
If using "\fI\%--type csv\fP" or
 
277
"\fI\%--type tsv\fP," use the first line as
 
278
field names. Otherwise, \fI\%mongoimport\fP will import the first
 
279
line as a distinct document.
 
280
.UNINDENT
 
281
.INDENT 0.0
85
282
.TP
86
283
.B \-\-upsert
87
 
insert or update objects that already exist
 
284
Modifies the import process to update existing objects in the
 
285
database if they match an imported object, while inserting all
 
286
other objects.
 
287
.sp
 
288
If you do not specify a field or fields using the
 
289
\fI\%--upsertFields\fP \fI\%mongoimport\fP will upsert on the
 
290
basis of the \fB_id\fP field.
 
291
.UNINDENT
 
292
.INDENT 0.0
88
293
.TP
89
 
.B \-\-upsertFields ARG
90
 
comma-separated fields for the query part of the upsert. You should
91
 
make sure this is indexed
 
294
.B \-\-upsertFields <field1[,field2]>
 
295
Specifies a list of fields for the query portion of the
 
296
\fIupsert\fP. Use this option if the \fB_id\fP fields in the
 
297
existing documents don\(aqt match the field in the document, but
 
298
another field or field combination can uniquely identify
 
299
documents as a basis for performing upsert operations.
 
300
.sp
 
301
To ensure adequate performance, indexes should exist for this
 
302
field or fields.
 
303
.UNINDENT
 
304
.INDENT 0.0
92
305
.TP
93
306
.B \-\-stopOnError
94
 
stop importing at first error rather than continuing
 
307
New in version 2.2.
 
308
.sp
 
309
Forces \fI\%mongoimport\fP to halt the import operation at the
 
310
first error rather than continuing the operation despite errors.
 
311
.UNINDENT
 
312
.INDENT 0.0
95
313
.TP
96
314
.B \-\-jsonArray
97
 
load a json array, not one item per line. Currently limited to 16MB.
98
 
.SH "COPYRIGHT"
99
 
.PP
100
 
Copyright 2007\-2011 10gen
101
 
.SH "SEE ALSO"
102
 
For more information, please refer to the MongoDB wiki, available at http://www.mongodb.org.
103
 
.SH "AUTHOR"
104
 
Kristina Chodorow
 
315
Changed in version 2.2: The limit on document size increased from 4MB to 16MB.
 
316
.sp
 
317
Accept import of data expressed with multiple MongoDB document
 
318
within a single \fIJSON\fP array.
 
319
.sp
 
320
Use in conjunction with \fImongoexport \-\-jsonArray\fP to
 
321
import data written as a single \fIJSON\fP array. Limited to
 
322
imports of 16 MB or smaller.
 
323
.UNINDENT
 
324
.SH USAGE
 
325
.sp
 
326
In this example, \fI\%mongoimport\fP imports the \fIcsv\fP
 
327
formatted data in the \fB/opt/backups/contacts.csv\fP into the
 
328
collection \fBcontacts\fP in the \fBusers\fP database on the MongoDB
 
329
instance running on the localhost port numbered \fB27017\fP.
 
330
.sp
 
331
.nf
 
332
.ft C
 
333
mongoimport \-\-db users \-\-collection contacts \-\-type csv \-\-file /opt/backups/contacts.csv
 
334
.ft P
 
335
.fi
 
336
.sp
 
337
In the following example, \fI\%mongoimport\fP imports the data in
 
338
the \fIJSON\fP formatted file \fBcontacts.json\fP into the collection
 
339
\fBcontacts\fP on the MongoDB instance running on the localhost port
 
340
number 27017. Journaling is explicitly enabled.
 
341
.sp
 
342
.nf
 
343
.ft C
 
344
mongoimport \-\-collection contacts \-\-file contacts.json \-\-journal
 
345
.ft P
 
346
.fi
 
347
.sp
 
348
In the next example, \fI\%mongoimport\fP takes data passed to it on
 
349
standard input (i.e. with a \fB|\fP pipe.)  and imports it into the
 
350
collection \fBcontacts\fP in the \fBsales\fP database is the
 
351
MongoDB datafiles located at \fB/srv/mongodb/\fP. if the import process
 
352
encounters an error, the \fI\%mongoimport\fP will halt because of
 
353
the \fI\%--stopOnError\fP option.
 
354
.sp
 
355
.nf
 
356
.ft C
 
357
mongoimport \-\-db sales \-\-collection contacts \-\-stopOnError \-\-dbpath /srv/mongodb/
 
358
.ft P
 
359
.fi
 
360
.sp
 
361
In the final example, \fI\%mongoimport\fP imports data from the
 
362
file \fB/opt/backups/mdb1\-examplenet.json\fP into the collection
 
363
\fBcontacts\fP within the database \fBmarketing\fP on a remote MongoDB
 
364
database. This \fI\%mongoimport\fP accesses the \fBmongod\fP
 
365
instance running on the host \fBmongodb1.example.net\fP over port
 
366
\fB37017\fP, which requires the username \fBuser\fP and the password
 
367
\fBpass\fP.
 
368
.sp
 
369
.nf
 
370
.ft C
 
371
mongoimport \-\-host mongodb1.example.net \-\-port 37017 \-\-username user \-\-password pass \-\-collection contacts \-\-db marketing \-\-file /opt/backups/mdb1\-examplenet.json
 
372
.ft P
 
373
.fi
 
374
.SH AUTHOR
 
375
MongoDB Documentation Project
 
376
.SH COPYRIGHT
 
377
2011-2013, 10gen, Inc.
 
378
.\" Generated by docutils manpage writer.
 
379
.