Skip to content

DOCS-4678: documents --type for mongoexport #2118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions source/includes/options-mongoexport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ description: |
Specifies a field or fields to *include* in the export. Use a comma
separated list of fields to specify multiple fields.

For :option:`--csv <mongoexport --csv>` output formats,
For :option:`csv <mongoexport --type>` output formats,
:program:`mongoexport` includes only the specified field(s), and the
specified field(s) can be a field within a sub-document.

Expand All @@ -195,7 +195,8 @@ description: |
An alternative to :option:`--fields <mongoexport --fields>`. The
{{role}} option allows you to
specify in a file the field or fields to *include* in the export and is
**only valid** with the :option:`--csv <mongoexport --csv>` option. The
**only valid** with the :option:`--type <mongoexport --type>` option
with value ``csv``. The
file must have only one field per line, and the line(s) must end with
the LF character (``0x0A``).

Expand Down Expand Up @@ -244,18 +245,21 @@ description: |
optional: true
---
program: mongoexport
name: csv
name: type
directive: option
args: null
args: <string>
description: |
Changes the export format to a comma-separated-values (CSV)
format. By default :program:`mongoexport` writes data using one
:term:`JSON` document for every MongoDB document.

If you specify {{role}}, then you must also use either
.. versionadded:: 2.8.0

Specifies the file type to export. The default format is :term:`JSON`,
bit it is possible to export :term:`csv` files.

If you specify ``csv``, then you must also use either
the :option:`--fields` or the :option:`--fieldFile` option to
declare the fields to export from the collection.
optional: true
default: json
---
program: mongoexport
name: out
Expand Down
2 changes: 1 addition & 1 deletion source/reference/program/mongoexport.txt
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Options

.. include:: /includes/option/option-mongoexport-query.rst

.. include:: /includes/option/option-mongoexport-csv.rst
.. include:: /includes/option/option-mongoexport-type.rst

.. include:: /includes/option/option-mongoexport-out.rst

Expand Down
6 changes: 5 additions & 1 deletion source/release-notes/2.8-compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Version Compatibility
~~~~~~~~~~~~~~~~~~~~~

:program:`mongod` instances before 2.6.6 cannot perform an initial sync
against 2.8 replica set members. Do not add :program:`mongod 2.6.6
against 2.8 replica set members. Do not add :program:`mongod` 2.6.6
members to a replica set that has 2.8 members.

.. _2.8-oplog-format-change:
Expand Down Expand Up @@ -214,6 +214,10 @@ Removed Options

- Removed ``--locks`` option for :program:`mongotop`.

- Remove ``--csv`` option for :program:`mongoexport`. Replaced with
:option:`--type <mongoexport --type>`, which specifies the
export type (``csv`` or ``json``).

.. seealso:: :ref:`2.8-tools-enhancements`

Sharded Cluster Setting
Expand Down