03 Get Value
Pull one field out by dot-path — ZMongo 03 Get Value
- session
- json
- value
- exists
- value_type
- refresh
03 Get Value is the node you'll reach for more than any other read node in ComfyUI-ZMongo. It fetches a document and pulls out one field, addressed by dot-path, returning it as a string you can wire directly into a CLIP text encoder, a KSampler widget, or anywhere else a value needs to go. If ZMongo is your prompt hub, this is the "load my prompt from the database" node - the one that finally decouples your workflow from hardcoded text.
The dot-path is the key idea. ZMongo documents are nested, and you address deep fields with dots: prompt.positive, image_data.metadata.seed, or prompt.ltxv_i2v_121f_16fps_720p.positive (an actual path from the pack's example workflows). Leave field_path empty and you get the whole document as JSON.
How it works
The node calls session.get_doc() for the collection/document, then walks the dot-path into the result. Outputs:
value- the extracted field as a string. Dicts and lists get JSON-serialized, scalars get stringified, missing gets yourfallback.exists- boolean, whether the field was actually found. Use this to distinguish "value is empty" from "value doesn't exist".value_type- a string describing what kind of value it was (so you can branch on "is this a number or an object").json- the raw response for debugging.refresh- a token that changes whenever inputs change, for downstream cache invalidation.
fallback is your safety net: if the path doesn't resolve, you get the fallback instead of a blank. cache defaults to false for always-fresh reads.
The inputs and outputs that matter
session,collection_name,document_id- the trio every document node needs.field_path- the dot-path. This is the input you'll fiddle with constantly.fallback- what to return when the path is missing. Set it andexistsbecomes a "did I find it" flag rather than a mystery.
The value output is the one to wire downstream. For a prompt stored at prompt.positive, that output feeds straight into a CLIP Text Encode node.
Install
Same pack install as always:
cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo
cd ComfyUI-ZMongo
pip install -r requirements.txt
or ComfyUI Manager → "ComfyUI-ZMongo" → restart.
Troubleshooting
- Empty
valuewithexists: false- the dot-path doesn't match. Check the actual key structure with04 Metadata Flattened Paths; ZMongo wraps binary data inbytesenvelopes, so a field likeimage_data.datawon't resolve the way you'd guess. - Empty
valuewithexists: true- the field exists but is genuinely empty, or it's a binary envelope. Look atvalue_typeandjson. - Value comes back serialized when you wanted raw text - dicts and lists are returned as JSON strings by design. Use
99 JSON Pickif you need a sub-field of a returned object. - Stale values - if you're caching reads (
cache: true), arefreshtoken mismatch tells you to re-read. When in doubt, cache off.
Get Value is the workhorse of the whole pack - learn its dot-path syntax and ZMongo starts feeling like a proper parameter library instead of a pile of JSON.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| session | ZMONGO_API_SESSION | — | |
| collection_name | STRING | — | |
| document_id | STRING | — | |
| field_path | STRING | — | |
| fallback | STRING | — | |
| cache | BOOLEAN | false | — |
| refresh_tokenopt | STRING | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| json | STRING | — |
| value | STRING | — |
| exists | BOOLEAN | — |
| value_type | STRING | — |
| refresh | STRING | — |