Document helper inventory

HelperCanonicalStatusProjectionPredicateSelector typeDiagnostic
doc_get_textdoc_get_textsupportedsupportedequality_range_instring
doc_get_intdoc_get_intsupportedsupportedequality_range_innumber_exact_int32non-integral or out-of-range JSON numbers project as NULL
doc_get_bigintdoc_get_bigintsupportedsupportedequality_range_innumber_exact_int64non-integral or out-of-range JSON numbers project as NULL
doc_get_booleandoc_get_booleansupportedsupportedequality_inboolean
doc_get_booldoc_get_booleanaliassupportedequality_inbooleancompatibility alias for doc_get_boolean
doc_get_vectordoc_get_vectorsupportedsupportedann_order_byvectorfixed-shape document vector helper requires a positive dimension argument
doc_path_statedoc_path_statesupportedsupportedequality_inpath_stateexplicit path-state selector; DOC_STATE_VALUE=0, DOC_STATE_NULL=1, DOC_STATE_MISSING=2, DOC_STATE_MISMATCH=3
doc_get_numberdoc_get_numbersupportedsupportedequality_range_innumberuses document_number_selector_key_codec:v1:cql_decimal_canonical_bytes for selector equality and range ordering
doc_is_nulldoc_is_nullsupportedsupportedequality_true_in_truepath_stateexplicit null-state helper; predicates admit true only and bind to DOC_STATE_NULL
doc_contains_pathdoc_contains_pathsupportedsupportedequality_inpath_statebounded document path existence helper; true for value or explicit null, false for missing or mismatch
doc_jsonpath_matchdoc_jsonpath_matchsupportedsupportedequality_inbooleanbounded fixed-shape JSONPath subset: one rooted selector, optional single wildcard, scalar comparison or existence
doc_containsdoc_containssupportedsupportedequality_inanybounded exact containment helper for object containment and scalar-array membership verification
doc_setdoc_setreservedrefusedmutation_onlydocumentdocument mutation remains on the D4B UPDATE surface, not SELECT helper predicates
doc_deletedoc_deletereservedrefusedmutation_onlydocumentdocument mutation remains on the D4B UPDATE surface, not SELECT helper predicates
doc_merge_patchdoc_merge_patchreservedrefusedmutation_onlydocumentdocument mutation remains on the D4B UPDATE surface, not SELECT helper predicates
doc_incdoc_increservedrefusedmutation_onlydocumentdocument mutation remains on the D4B UPDATE surface, not SELECT helper predicates
doc_array_appenddoc_array_appendreservedrefusedmutation_onlydocumentdocument mutation remains on the D4B UPDATE surface, not SELECT helper predicates
doc_array_removedoc_array_removereservedrefusedmutation_onlydocumentdocument mutation remains on the D4B UPDATE surface, not SELECT helper predicates

Examples

Document selectors

CREATE INDEX events_doc_category_idx
ON app.events (doc_get_text(doc, '$.category'))
USING 'sis'
WITH OPTIONS = {'family':'auto'};

WAIT FOR INDEX events_doc_category_idx QUERYABLE TIMEOUT '60 seconds';

SELECT id, doc_get_text(doc, '$.category') AS category
FROM app.events
WHERE tenant = 'tenant-alpha'
  AND doc_get_text(doc, '$.category') = 'returns'
LIMIT 20;

Supported document projection and predicate helper families include:

Helper family Predicate use
doc_get_text, doc_get_int, doc_get_bigint, doc_get_numberEquality, IN, and bounded ranges when a matching queryable selector exists.
doc_get_boolean / doc_get_boolEquality and IN.
doc_get_vectorORDER BY doc_get_vector(...) ANN OF ... with a queryable vector selector.
doc_path_state, doc_is_null, doc_contains_pathExplicit value/null/missing/mismatch/path-existence state checks.
doc_jsonpath_match, doc_containsBounded fixed-shape JSONPath and exact-containment subsets.

Examples

Document mutation functions

Document mutations are UPDATE assignment helpers, not SELECT helpers.

UPDATE app.events
SET doc = DOC_SET(doc, '$.priority', 'critical', true)
WHERE tenant = 'tenant-alpha' AND id = 'e1';

UPDATE app.events
SET doc = DOC_DELETE(doc, '$.deprecated')
WHERE tenant = 'tenant-alpha' AND id = 'e1';

UPDATE app.events
SET doc = DOC_MERGE_PATCH(doc, fromJson('{"category":"returns","tags":["vip"]}'))
WHERE tenant = 'tenant-alpha' AND id = 'e1';

UPDATE app.events
SET doc = DOC_INC(doc, '$.retry_count', 1)
WHERE tenant = 'tenant-alpha' AND id = 'e1';

UPDATE app.events
SET doc = DOC_ARRAY_APPEND(doc, '$.tags', 'urgent')
WHERE tenant = 'tenant-alpha' AND id = 'e1';

UPDATE app.events
SET doc = DOC_ARRAY_REMOVE(doc, '$.tags', 'stale')
WHERE tenant = 'tenant-alpha' AND id = 'e1';