03 Create Doc
Parking structured data in your ZMongo store
- session
- json
- document_id
- refresh
03 Create Doc saves a full JSON document into a ZMongo collection in one shot. Where the pack's other write nodes tuck a single value into a field, this one lets you insert a complete structured object - a prompt bundle, a config blob, a generation record - as a first-class document.
This is the node you reach for when you want to store the shape of something, not just a string. Say you want to keep a reusable prompt library where each entry is {"name": ..., "positive": ..., "negative": ..., "cfg": 6.5, "steps": 30}. That's a document, and Create Doc is how it gets in. The README's framing nails the pitch: saving raw prompt structures, negative weights, and runtime configurations without typing a line of code.
How it works
Three required inputs:
session- from the API Key Session node.collection_name- which collection the document lands in.document_json- the document body as JSON text. Multiline field, defaults to{}.
It parses document_json and sends it to the backend's create-document route. Outputs:
json- the backend response, including the server-assigned id.document_id- the string id of the new document, pulled from the response (document_id,inserted_id, or_iddepending on what the backend returns). This is the useful one - wire it downstream so later nodes can target this exact document.refresh- dirty token for forcing list/count refreshes.
Tips
- If you don't specify a
document_idyourself, the backend generates one. If you do want stable, human-readable ids (likeprompt_ltxv_v3), check whether your backend's document write path lets you set one - some do. - Malformed JSON fails cleanly: you get an error payload out of
json, an emptydocument_id, and the node doesn't crash the graph. - Classic first workflow: Create Doc → wire
document_idinto a 03 Get Doc or a Gemini node that reads from ZMongo. You save once, then everything downstream reads the same stable record.
Install
Via ComfyUI Manager (search ComfyUI-ZMongo) or:
cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo
then restart ComfyUI. Reminder that this pack's requirements.txt is much heavier than the README's short install line - the first import pulls in langchain and friends and can take a minute.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| session | ZMONGO_API_SESSION | — | |
| collection_name | STRING | — | |
| document_json | STRING | {} | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| json | STRING | — |
| document_id | STRING | — |
| refresh | STRING | — |