06 Get Document
Pull one whole document out of the database, without touching JSON
- session
- document_id_link
- json
- document_id
- document_json
- text
- summary
- success
- refresh
- document_ids
- selectable_items
- indexed_items
- item_count
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 recordtext- the document's top-leveltextfield, 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 isdocument_id- the resolved ID (echoes back what you passed)success- BOOLEAN, the usual go/no-godocument_idslist 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.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| session | ZMONGO_API_SESSION | — | |
| document_id | STRING | — | |
| include_file_data | BOOLEAN | false | — |
| document_prefix | STRING | /documents | — |
| document_id_linkopt | * | — | |
| refresh_tokenopt | STRING | — |
Outputs (11)
| Name | Type | Description |
|---|---|---|
| json | STRING | — |
| document_id | STRING | — |
| document_json | STRING | — |
| text | STRING | — |
| summary | STRING | — |
| success | BOOLEAN | — |
| refresh | STRING | — |
| document_ids | * | — |
| selectable_items | * | — |
| indexed_items | STRING | — |
| item_count | INT | — |