@@ -49,32 +49,46 @@ that it is formatted correctly.
4949 name: JSON
5050 content: |
5151
52- When importing data from a **JSON** file, each document must exist on
53- its own line in the file. Do not use commas at the end of lines to
54- separate documents.
52+ When importing data from a **JSON** file, you can format your
53+ data as:
54+
55+ - Newline-delimited documents, or
56+
57+ - Comma-separated documents in an array
5558
5659 .. example::
5760
58- The following ``.json`` file imports three documents:
61+ The following newline-delimited ``.json`` file is formatted
62+ correctly:
5963
6064 .. code-block:: javascript
6165
6266 { "type": "home", "number": "212-555-1234" }
6367 { "type": "cell", "number": "646-555-4567" }
6468 { "type": "office", "number": "202-555-0182"}
6569
66- |compass| automatically generates :manual:`ObjectIDs
70+ The following comma-separated ``.json`` array file is also
71+ formatted correctly:
72+
73+ .. code-block:: javascript
74+
75+ [{ "type": "home", "number": "212-555-1234" }, { "type": "cell", "number": "646-555-4567" }, { "type": "office", "number": "202-555-0182"}]
76+
77+ |compass-short| ignores line breaks in JSON arrays.
78+
79+ |compass-short| automatically generates :manual:`ObjectIDs
6780 </reference/method/ObjectId/>` for these objects on import
6881 since no ObjectIDs were specified in the initial JSON.
6982
7083 - id: csv
7184 name: CSV
7285 content: |
7386
74- When importing data from a **CSV** file, the first line of the file
75- must be a comma-separated list of your document field names. Subsequent
76- lines in the file must be comma-separated field values in the order
77- corresponding with the field order in the first line.
87+ When importing data from a **CSV** file, the first line of the
88+ file must be a comma-separated list of your document field
89+ names. Subsequent lines in the file must be comma-separated
90+ field values in the order corresponding with the field order
91+ in the first line.
7892
7993 .. example::
8094
@@ -109,9 +123,8 @@ Export Data from a Collection
109123
110124|compass| can export data from a collection as either a
111125**JSON** or **CSV** file. If you specify a
112- :ref:`filter <query-bar-filter>` in the
113- :ref:`query bar <compass-query-bar>` prior to export, |compass-short|
114- can optionally only export documents which match the specified query.
126+ :ref:`filter <query-bar-filter>`, |compass-short| only exports
127+ documents which match the specified query.
115128
116129Behavior
117130~~~~~~~~
@@ -136,20 +149,6 @@ Procedure
136149
137150 .. include:: /includes/fact-export-progress-bar.rst
138151
139- Example
140- ```````
141-
142- The following example exports the entire ``test.people``
143- collection as a ``.json`` file called ``test-export.json``:
144-
145- .. figure:: /images/compass/export-data-example.png
146- :alt: Export data example
147- :figwidth: 600px
148-
149- The specified ``{ age: 24 }`` query is ignored and the entire
150- collection is exported because the
151- :guilabel:`Export Full Collection` toggle is enabled.
152-
153152 .. tab:: Export Filtered Subset of a Collection
154153 :tabid: export-filter
155154
@@ -158,15 +157,3 @@ Procedure
158157 .. include:: /includes/steps/export-filter.rst
159158
160159 .. include:: /includes/fact-export-progress-bar.rst
161-
162- Example
163- ```````
164-
165- The following example a filtered subset of the
166- ``test.flightStats`` collection as a CSV file called
167- ``cvg-msp.csv``. Only documents with an ``arrivalAirportFsCode``
168- of either ``CVG`` or ``MSP`` are included in hte export.
169-
170- .. figure:: /images/compass/export-data-filter-example.png
171- :alt: Export data with filter example
172- :figwidth: 600px
0 commit comments