Skip to main content

Module values

Module values 

Source
Expand description

The model’s JSON answers → PackStream, and the client’s PackStream parameters → JSON.

Model → wire. A record value is plain JSON: strings, numbers, booleans, null, arrays and objects become PackStream strings, integers or floats, booleans, null, lists and maps. Three single-key objects are graph values instead, so a client renders them as nodes, relationships and paths rather than as maps:

{"$node": {"id": 1, "labels": ["Person"], "properties": {"name": "Alice"}}}
{"$relationship": {"id": 7, "type": "KNOWS", "start": 1, "end": 2, "properties": {}}}
{"$path": {"nodes": [{"id": 1, "labels": ["Person"]}, {"id": 2, "labels": ["Person"]}],
           "relationships": [{"id": 7, "type": "KNOWS", "start": 1, "end": 2}]}}

element_id (and a relationship’s start_element_id / end_element_id) may be given; each defaults to the decimal string of the matching integer id. A path’s relationships[i] must connect nodes[i] and nodes[i + 1] in either direction, and NetGet computes the Bolt path index sequence (1-based relationship index, negative when traversed backwards; 0-based node index) itself. Temporal and spatial values are not in the set — give them as strings.

Client → model. RUN’s parameters arrive as PackStream and reach the model as JSON. Bytes become {"$bytes_length": n} (never the bytes: the event-design rule) and any structure becomes {"$structure": "<name>", "fields": [...]} using Bolt’s structure names.

Both directions are bounded to MAX_PACKSTREAM_DEPTH, so NetGet never emits a value its own decoder would refuse.

Structs§

QueryAnswer
A validated answer to one query: column names, rows, and the summary it ends with.

Constants§

MAX_ACTION_DEPTH
Preflight handler values before recursive copies or conversion. The JSON action envelope and graph wrappers need four additional levels beyond wire containers.
MAX_ACTION_NODES
MAX_ACTION_RETAINED_BYTES
STAT_COUNTERS
Query statistics Bolt reports in a result summary, as Neo4j names them on the wire.
TAG_NODE
Bolt structure tags for the graph types.
TAG_PATH
TAG_RELATIONSHIP
TAG_UNBOUND_RELATIONSHIP

Functions§

action_within_budget
json_to_value
Convert a JSON value the model wrote into a PackStream value.
query_answer
Build a QueryAnswer from a send_bolt_records action, refusing anything a client would misread: a record whose width differs from fields, a duplicate or empty column name, an unknown query_type or statistic.
stats_value
The model’s stats object (nodes_created or nodes-created, integer counts) → Bolt’s stats map, with contains-updates / contains-system-updates derived. Unknown keys and negative counts are refused.
structure_name
Bolt’s name for a structure tag, for describing parameters to the model.
valid_failure_code
A Neo4j status code the model may send in a FAILURE: Neo.<Classification>.<Category>.<Title> with the classification one of ClientError, TransientError or DatabaseError.
value_to_json
A decoded PackStream value as JSON for an event. Never carries raw bytes.