Skip to content

Commit

Permalink
Added missing docs for ignore-null-fields for JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
rjrudin committed Oct 23, 2024
1 parent 9ae6d0f commit fa49c0d
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docs/import/import-files/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,39 @@ can help with indexing purposes in MarkLogic as well. To include a JSON root fie
use the `--json-root-name` option with a value for the name of the root field. The data read from a
row will then be nested under this root field.

## Ignoring null fields

By default, Flux will include any fields in a JSON Lines file that have a null value (this does not include
a value that has whitespace) when creating JSON or XML documents. You can instead ignore fields with a null value
via the `--ignore-null-fields` option:

{% tabs log %}
{% tab log Unix %}
```
./bin/flux import-aggregate-json-files \
--json-lines \
--path path/to/file.txt \
--connection-string "flux-example-user:password@localhost:8004" \
--permissions flux-example-role,read,flux-example-role,update \
--ignore-null-fields
```
{% endtab %}
{% tab log Windows %}
```
bin\flux import-aggregate-json-files ^
--json-lines ^
--path path\to\file.txt ^
--connection-string "flux-example-user:password@localhost:8004" ^
--permissions flux-example-role,read,flux-example-role,update ^
--ignore-null-fields
```
{% endtab %}
{% endtabs %}

The decision on whether to include null fields will depend on your application requirements. For example, if your
documents have large numbers of null fields, you may find them to be noise and decide to ignore them. In another case,
it may be important to query for documents that have a particular field with a value of null.

## Specifying an encoding

MarkLogic stores all content [in the UTF-8 encoding](https://docs.marklogic.com/guide/search-dev/encodings_collations#id_87576).
Expand Down

0 comments on commit fa49c0d

Please sign in to comment.