Nodes/ComfyUI-ZMongo/03 Create Doc
ComfyUI Node

03 Create Doc

Parking structured data in your ZMongo store

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
03 Create Doc
  • session
  • json
  • document_id
  • refresh
collection_name
document_json{}

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 _id depending 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_id yourself, the backend generates one. If you do want stable, human-readable ids (like prompt_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 empty document_id, and the node doesn't crash the graph.
  • Classic first workflow: Create Doc → wire document_id into 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.

CategoryZMongo/02 Docs

Inputs (3)

NameTypeDefaultDescription
sessionZMONGO_API_SESSION
collection_nameSTRING
document_jsonSTRING{}

Outputs (3)

NameTypeDescription
jsonSTRING
document_idSTRING
refreshSTRING