Skip to content

Commit 2c3a09b

Browse files
authored
Merge pull request #283 from marklogic/feature/17292-array-docs
MLE-17292 Added docs note about JSON array support
2 parents fa49c0d + a0d8386 commit 2c3a09b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/import/import-files/json.md

+16
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,22 @@ The URI of each document will default to a UUID followed by `.json`. To include
4949
include the `--uri-include-file-path` option. You can also make use of the
5050
[common import features](../common-import-features.md) for controlling document URIs.
5151

52+
Note that Flux's support for an array of objects requires the root of the JSON to be an array. For example, consider
53+
a file containing the following JSON:
54+
55+
```
56+
{
57+
"items": [
58+
{"id": 1},
59+
{"id": 2}
60+
]
61+
}
62+
```
63+
64+
Flux can only import the above JSON as an object which becomes a single document. If you wish to instead import each
65+
object in the `items` array as a separate JSON document, consider pre-processing the file by removing the outer
66+
object so that the file only contains an array.
67+
5268
## Importing JSON Lines files
5369

5470
If your files conform to the [JSON Lines format](https://jsonlines.org/),

0 commit comments

Comments
 (0)