Nodes/ComfyUI-ZMongo/03 Get Value
ComfyUI Node

03 Get Value

Pull one field out by dot-path — ZMongo 03 Get Value

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
03 Get Value
  • session
  • json
  • value
  • exists
  • value_type
  • refresh
collection_name
document_id
field_path
fallback
cachefalse
refresh_token

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 your fallback.
  • 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 and exists becomes 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 value with exists: false - the dot-path doesn't match. Check the actual key structure with 04 Metadata Flattened Paths; ZMongo wraps binary data in bytes envelopes, so a field like image_data.data won't resolve the way you'd guess.
  • Empty value with exists: true - the field exists but is genuinely empty, or it's a binary envelope. Look at value_type and json.
  • Value comes back serialized when you wanted raw text - dicts and lists are returned as JSON strings by design. Use 99 JSON Pick if you need a sub-field of a returned object.
  • Stale values - if you're caching reads (cache: true), a refresh token 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.

CategoryZMongo/02 Docs

Inputs (7)

NameTypeDefaultDescription
sessionZMONGO_API_SESSION
collection_nameSTRING
document_idSTRING
field_pathSTRING
fallbackSTRING
cacheBOOLEANfalse
refresh_tokenoptSTRING

Outputs (5)

NameTypeDescription
jsonSTRING
valueSTRING
existsBOOLEAN
value_typeSTRING
refreshSTRING