Nodes/ComfyUI-ZMongo/06 Get Document
ComfyUI Node

06 Get Document

Pull one whole document out of the database, without touching JSON

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
06 Get Document
  • session
  • document_id_link
  • json
  • document_id
  • document_json
  • text
  • summary
  • success
  • refresh
  • document_ids
  • selectable_items
  • indexed_items
  • item_count
document_id
include_file_datafalse
document_prefix/documents
refresh_token

Once you've got a document ID in hand, "06 Get Document" is the node that turns it back into something you can actually use. It fetches one full document by ID and hands it to you both as raw JSON and as a few pre-extracted convenience outputs. It's the read counterpart to "06 Upload Document File" and "06 Save Document Text" - if your workflow saved it, this is how you get it back.

How it works

It GETs /api/get/{document_id} with the ID URL-encoded. The document_id input is a plain STRING, but you should almost always wire it from the typed document_id_link output of something like "06 Select Nth Document Item" or "06 List Documents" instead - that link output is guarded so you don't accidentally feed it a filename or field path and get a confusing miss. There's also a document_prefix (default /documents) for the route base, which you can leave alone unless your backend uses a custom prefix.

The include_file_data toggle (default false) controls whether binary file attachments ride along in the response. Leave it off unless you specifically need the file bytes - it keeps the payload small and fast.

Outputs worth knowing:

  • document_json - the full document as a JSON string; wire this to a text/JSON viewer if you want to eyeball the whole record
  • text - the document's top-level text field, pre-extracted (most text docs store their content there)
  • summary - a short summary generated from the document, handy when you just need to know what this document is
  • document_id - the resolved ID (echoes back what you passed)
  • success - BOOLEAN, the usual go/no-go
  • document_ids list plus the standard selectable tail

Install

Same pack, same drill:

cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo

Restart ComfyUI, or install "ComfyUI-ZMongo" from ComfyUI Manager.

Where people get burned

The number one failure mode is feeding the wrong thing into document_id. The document_id field is untyped and happy to accept any string, but the semantic link outputs elsewhere in this pack exist precisely because people kept wiring filenames and field paths into ID sockets and getting "not found." Use the document_id_link outputs from the selector/list nodes and this stops biting you.

Also, an empty ID returns a clean failure payload rather than a crash - which is by design (this whole suite is built to not kill your graph), but it means success: false with no ID is you forgetting to wire the ID, not the backend misbehaving. If that happens, check the connection between your list/selector node and this one before you go hunting in the database.

The other subtle one: include_file_data only matters if your documents actually carry file data. Toggling it on an ordinary text document changes nothing. If you're after text, just use the text output and skip the toggle entirely.

CategoryZMongo/03 Documents

Inputs (6)

NameTypeDefaultDescription
sessionZMONGO_API_SESSION
document_idSTRING
include_file_dataBOOLEANfalse
document_prefixSTRING/documents
document_id_linkopt*
refresh_tokenoptSTRING

Outputs (11)

NameTypeDescription
jsonSTRING
document_idSTRING
document_jsonSTRING
textSTRING
summarySTRING
successBOOLEAN
refreshSTRING
document_ids*
selectable_items*
indexed_itemsSTRING
item_countINT