From 271ca48efabe8d3a278eef412a75e715a2a86d44 Mon Sep 17 00:00:00 2001 From: kay Date: Tue, 16 Apr 2013 16:51:28 -0400 Subject: [PATCH] DOCS-1241 mongoexport with fields from subdocuments incorporate Spencer's comments --- source/reference/mongoexport.txt | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/source/reference/mongoexport.txt b/source/reference/mongoexport.txt index 96880217379..2c435ecb118 100644 --- a/source/reference/mongoexport.txt +++ b/source/reference/mongoexport.txt @@ -134,18 +134,30 @@ Options .. option:: --fields , -f - Specify a field or number fields to *include* in the export. All - other fields will be *excluded* from the export. Comma separate a - list of fields to limit the fields exported. + Specify a field or fields to *include* in the export. Use a comma + separated list of fields to specify multiple fields. + + For :option:`CSV ` output formats, + :program:`mongoexport` includes only the specified field(s), and the + specified field(s) can be a field within a subdocument. + + For :term:`JSON` output formats, :program:`mongoexport` includes + only the specified field(s) **and** the ``_id`` field, and if the + specified field(s) is a field within a subdocument, the + :program:`mongoexport` includes the subdocument with all + its fields, not just the specified field within the document. .. option:: --fieldFile - As an alternative to :option:`--fields `, - the :option:`--fieldFile` option allows you to specify a file - (e.g. ````) to hold a list of field names to specify a list - of fields to *include* in the export. All other fields will be - *excluded* from the export. Place one field per line. - Lines must end with the LF character (``0x0A``). + As an alternative to :option:`--fields `, the + :option:`--fieldFile ` 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 ` + option. The file must have only one field per line, and the line(s) + must end with the LF character (``0x0A``). + + :program:`mongoexport` includes only the specified field(s). The + specified field(s) can be a field within a subdocument. .. option:: --query