Skip to content

Commit a12afc8

Browse files
jeff-allen-mongokay-kim
authored andcommitted
DOCSP-1018 - Documenting --uri option for tools
1 parent 12ea239 commit a12afc8

15 files changed

+202
-87
lines changed

source/includes/options-mongodump.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ inherit:
3030
file: options-shared.yaml
3131
---
3232
program: mongodump
33+
name: uri
34+
inherit:
35+
name: uri
36+
program: _shared
37+
file: options-shared.yaml
38+
replacement:
39+
program: ":binary:`~bin.mongodump`"
40+
---
41+
program: mongodump
3342
name: host
3443
inherit:
3544
name: host

source/includes/options-mongoexport.yaml

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ inherit:
3030
file: options-shared.yaml
3131
---
3232
program: mongoexport
33+
name: uri
34+
inherit:
35+
name: uri
36+
program: _shared
37+
file: options-shared.yaml
38+
replacement:
39+
program: ":binary:`~bin.mongoexport`"
40+
---
41+
program: mongoexport
3342
name: host
3443
inherit:
3544
name: host
@@ -190,7 +199,7 @@ description: |
190199
specified field(s) is a field within a sub-document, the
191200
:binary:`~bin.mongoexport` includes the sub-document with all
192201
its fields, not just the specified field within the document.
193-
202+
194203
See: :ref:`mongoexport-fields-example` for sample usage.
195204
optional: true
196205
---
@@ -209,7 +218,7 @@ description: |
209218
210219
:binary:`~bin.mongoexport` includes only the specified field(s). The
211220
specified field(s) can be a field within a sub-document.
212-
221+
213222
See :ref:`mongoexport-fieldFile-example` for sample usage.
214223
optional: true
215224
---
@@ -302,13 +311,13 @@ args: null
302311
description: |
303312
.. deprecated:: 3.2
304313
305-
Sets the :ref:`replica-set-read-preference` to :readmode:`nearest`,
306-
allowing :binary:`~bin.mongoexport` to read data from secondary
314+
Sets the :ref:`replica-set-read-preference` to :readmode:`nearest`,
315+
allowing :binary:`~bin.mongoexport` to read data from secondary
307316
:term:`replica set` members.
308-
309-
:option:`--readPreference` replaces ``--slaveOk`` in MongoDB 3.2. You cannot
317+
318+
:option:`--readPreference` replaces ``--slaveOk`` in MongoDB 3.2. You cannot
310319
specify ``--slaveOk`` when :option:`--readPreference` is specified.
311-
320+
312321
.. include:: /includes/warning-read-preference-mongos.rst
313322
optional: true
314323
---
@@ -390,17 +399,17 @@ optional: true
390399
name: readPreference
391400
args: <string>
392401
description: |
393-
Specify the :ref:`read preference<replica-set-read-preference>` for
394-
{{program}}.
395-
402+
Specify the :ref:`read preference<replica-set-read-preference>` for
403+
{{program}}.
404+
396405
See :ref:`replica-set-read-preference-modes`.
397-
398-
{{program}} defaults to :readmode:`primary`
399-
:ref:`read preference <replica-set-read-preference>` when connected to a
406+
407+
{{program}} defaults to :readmode:`primary`
408+
:ref:`read preference <replica-set-read-preference>` when connected to a
400409
:binary:`~bin.mongos` or a :term:`replica set`.
401-
410+
402411
Otherwise, {{program}} defaults to :readmode:`nearest`.
403-
412+
404413
.. include:: /includes/warning-read-preference-mongos.rst
405414
---
406415
program: mongoexport
@@ -410,12 +419,12 @@ name: noHeaderLine
410419
args: null
411420
description: |
412421
.. versionadded:: 3.4
413-
422+
414423
By default, {{program}} includes the exported field names as the first
415424
line in a CSV output. {{role}} directs {{program}} to export the
416425
data without the list of field names.
417426
{{role}} is **only valid** with the
418427
:option:`--type <mongoexport --type>` option with value ``csv``.
419-
428+
420429
See :ref:`mongoexport-noHeaderLine-example` for sample usage.
421430
...

source/includes/options-mongofiles.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ inherit:
3131
file: options-shared.yaml
3232
---
3333
program: mongofiles
34+
name: uri
35+
inherit:
36+
name: uri
37+
program: _shared
38+
file: options-shared.yaml
39+
replacement:
40+
program: ":binary:`~bin.mongofiles`"
41+
---
42+
program: mongofiles
3443
name: host
3544
directive: option
3645
args: <hostname><:port>

source/includes/options-mongoimport.yaml

Lines changed: 43 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@ inherit:
3030
file: options-shared.yaml
3131
---
3232
program: mongoimport
33+
name: uri
34+
inherit:
35+
name: uri
36+
program: _shared
37+
file: options-shared.yaml
38+
replacement:
39+
program: ":binary:`~bin.mongoimport`"
40+
---
41+
program: mongoimport
3342
name: host
3443
inherit:
3544
name: host
@@ -298,54 +307,54 @@ directive: option
298307
args: insert|upsert|merge
299308
description: |
300309
.. versionadded:: 3.4
301-
310+
302311
Specifies how the import process should handle existing documents
303312
in the database that match documents in the import file.
304313
305314
By default, {{program}} uses the ``_id`` field to match documents in
306315
the collection with documents in the import file.
307316
To specify the fields against which to match existing
308-
documents for the ``upsert`` and ``merge`` modes,
317+
documents for the ``upsert`` and ``merge`` modes,
309318
use :option:`--upsertFields`.
310319
311320
.. list-table::
312321
:header-rows: 1
313322
:widths: 20 40
314-
323+
315324
* - Value
316325
- Description
317-
326+
318327
* - ``insert``
319-
328+
320329
- Insert the documents in the import file. {{program}} will log
321330
an error if you attempt to import a document that contains a
322-
duplicate value for a field with a :ref:`unique index
331+
duplicate value for a field with a :ref:`unique index
323332
<index-type-unique>`, such as ``_id``.
324-
333+
325334
* - ``upsert``
326-
335+
327336
- Replace existing documents in the database with matching
328337
documents from the
329338
import file. {{program}} will insert all other
330339
documents. :ref:`ex-mongoimport-upsert` describes how to
331340
use {{role}} ``upsert``.
332-
341+
333342
* - ``merge``
334-
343+
335344
- Merge existing documents that match a document in the import file with
336-
the new document. {{program}} will insert all other documents.
345+
the new document. {{program}} will insert all other documents.
337346
:ref:`ex-mongoimport-merge` describes how to use {{role}}
338347
``merge``.
339348
340-
default: insert
349+
default: insert
341350
optional: true
342351
---
343352
program: mongoimport
344353
name: upsert
345354
directive: option
346355
args: null
347356
description: |
348-
.. deprecated:: 3.4 :option:`--mode` replaces {{role}}.
357+
.. deprecated:: 3.4 :option:`--mode` replaces {{role}}.
349358
350359
Modifies the import process to update existing objects in the
351360
database if they match an imported object, while inserting all
@@ -380,7 +389,7 @@ description: |
380389
database if they match based on the specified fields, while
381390
inserting all other objects. You do not need to use :option:`--mode
382391
upsert <--mode>` with {{role}}.
383-
392+
384393
If you do not specify a field, {{role}} will upsert on the basis of
385394
the ``_id`` field.
386395
@@ -449,73 +458,73 @@ description: |
449458
Instructs {{program}} that the
450459
field list specified in :option:`--fields`, :option:`--fieldFile`,
451460
or :option:`--headerline` specifies the types of each field.
452-
461+
453462
Field names must be in the form of ``<colName>.<type>(<arg>)``. You
454463
must backslash-escape the following characters if you wish to include
455464
them in an argument: ``(``, ``)``, and ``\``.
456-
465+
457466
.. list-table::
458467
:header-rows: 1
459468
:widths: 20 33 47
460469
461470
* - ``type``
462471
- Supported Arguments
463472
- Example Header Field
464-
473+
465474
* - ``auto()``
466475
- None.
467476
- ``misc.auto()``
468-
477+
469478
* - ``binary(<arg>)``
470-
- - ``base32`` (`RFC4648`_ encoding schema)
479+
- - ``base32`` (`RFC4648`_ encoding schema)
471480
- ``base64`` (`RFC4648`_ encoding schema)
472481
- ``hex``
473482
- ``user thumbnail.binary(base64)``
474-
483+
475484
* - ``boolean()``
476485
- None.
477486
- ``verified.boolean()``
478-
487+
479488
* - ``date(<arg>)``
480489
- Alias for ``date_go(<arg>)``. `Go Language time.Parse format`_.
481490
- ``created.date(2006-01-02 15:04:05)``
482-
491+
483492
* - ``date_go(<arg>)``
484493
- `Go Language time.Parse format`_
485494
- ``created.date_go(2006-01-02 15:04:05)``
486-
495+
487496
* - ``date_ms(<arg>)``
488-
- `Microsoft SQL Server FORMAT format
497+
- `Microsoft SQL Server FORMAT format
489498
<https://msdn.microsoft.com/en-us/library/hh213505.aspx>`_
490499
- ``created.date_ms(yyyy-MM-dd H:mm:ss)``
491-
500+
492501
* - ``date_oracle(<arg>)``
493-
- `Oracle Database TO_DATE format
502+
- `Oracle Database TO_DATE format
494503
<https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions183.htm>`_.
495504
- ``created.date_oracle(YYYY-MM-DD HH24:MI:SS)``
496505
497506
* - ``decimal()``
498507
- None
499-
- ``price.decimal()``
508+
- ``price.decimal()``
500509
501510
* - ``double()``
502511
- None.
503512
- ``revenue.double()``
504-
513+
505514
* - ``int32()``
506515
- None.
507516
- ``followerCount.int32()``
508-
517+
509518
* - ``int64()``
510519
- None.
511520
- ``bigNumber.int64()``
512-
521+
513522
* - ``string()``
514523
- None.
515524
- ``zipcode.string()``
516525
517526
.. _Go Language time.Parse format: https://golang.org/src/time/format.go
518-
.. _RFC4648: https://tools.ietf.org/html/rfc4648
527+
.. _RFC4648: https://tools.ietf.org/html/rfc4648
519528
520529
See :ref:`example-csv-import-types` for sample usage.
521530
@@ -529,10 +538,10 @@ pre: |
529538
530539
description: |
531540
Specifies how {{program}} handles type coercion failures when importing
532-
CSV or TSV files with :option:`--columnsHaveTypes`.
533-
541+
CSV or TSV files with :option:`--columnsHaveTypes`.
542+
534543
{{role}} has no effect when importing JSON documents.
535-
544+
536545
.. list-table::
537546
:widths: 20 80
538547
:header-rows: 1

source/includes/options-mongorestore.yaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ inherit:
3131
file: options-shared.yaml
3232
---
3333
program: mongorestore
34+
name: uri
35+
inherit:
36+
name: uri
37+
program: _shared
38+
file: options-shared.yaml
39+
replacement:
40+
program: ":binary:`~bin.mongorestore`"
41+
---
42+
program: mongorestore
3443
name: host
3544
inherit:
3645
name: host
@@ -229,7 +238,7 @@ description: |
229238
directory. When used in conjunction with :option:`mongodump --oplog`,
230239
:binary:`~bin.mongorestore --oplogReplay <mongorestore>`
231240
restores the database to the point-in-time backup captured with the
232-
``mongodump --oplog`` command.
241+
``mongodump --oplog`` command.
233242
234243
For an example of {{role}}, see :ref:`backup-restore-oplogreplay`.
235244
@@ -242,10 +251,10 @@ description: |
242251
243252
.. note::
244253
245-
When using :binary:`~bin.mongorestore` with {{role}}, you must
246-
restore a full dump of a :term:`replica set` member created
247-
using :binary:`~bin.mongodump --oplog <mongodump>`.
248-
:binary:`~bin.mongorestore` with {{role}} fails if you use any of
254+
When using :binary:`~bin.mongorestore` with {{role}}, you must
255+
restore a full dump of a :term:`replica set` member created
256+
using :binary:`~bin.mongodump --oplog <mongodump>`.
257+
:binary:`~bin.mongorestore` with {{role}} fails if you use any of
249258
the following options to limit the data be restored:
250259
251260
- :option:`--db`
@@ -512,6 +521,6 @@ pre: |
512521
description: |
513522
Runs {{program}} without actually importing any data, returning the
514523
{{program}} summary information. Use with ``--verbose`` to produce
515-
more detailed summary information.
524+
more detailed summary information.
516525
optional: true
517526
...

0 commit comments

Comments
 (0)