# Choose JSON declarations

Use plain JSON when any validated JSON document is acceptable. It can hold an object, array or scalar.

Use `JSON(path Type, ...)` when selected fields need declared types and dotted projection. This form requires an object and retains members that were not declared as typed paths.

## Defaults and missing paths

A missing or explicit-null typed path receives the type's default. For a number this is usually zero; Nullable paths remain NULL. Choose Nullable when the distinction between missing and zero matters.

Paths are case-sensitive and cannot duplicate or overlap a declared parent. A scalar parent where an object is required is rejected.

## Example

```sql
CREATE TABLE documents(doc JSON(id UInt64, comment Nullable(String)));
INSERT INTO documents VALUES ('{"id":7}');
```

```sql
SELECT doc.id, doc.comment
FROM documents
FORMAT csv;
```

```text
7,\N
```

The id has a native integer contract, while an absent comment remains missing. See [JSON](https://coordinatordb.com/docs/reference/data-types/json) for nested typed paths and [JSON functions](https://coordinatordb.com/docs/reference/functions/regular-functions/json-functions) for document operations.
