Document collections

The Database section is the workspace’s JSON document store. A collection is a schemaless table: it has a name, a description and documents — arbitrary JSON objects. On insert every document gets an _id field (you may supply your own value).

When you need one

Reach for a collection when the data outlives the run and you need to select it by field: orders, customer records, a catalogue, a log of messages already handled.

Other jobs have other homes. Meaning-based search over document text is a knowledge base. A single value per session — a counter, a flag, the last choice — is cheaper in variables and memory than in a collection of its own.

app.iterna.ai

Database

orders

1,248 documents · 3.4 MB used

QueryInsert
_idcustomerstatustotal
a3f1…acmepaid12,400
b7c2…globexpending980
Collections on the left, the documents of the selected collection on the right.

Collections are created with New collection; a document can be inserted and edited right in the interface (Insert, Edit), and the Query button runs the same filter over the collection that you will later put into a node.

The nodes

Entry
DB Insert
Exit
  • Execute + Data
A request from the chat lands in a collection.
Node What it does What it returns
db_insert Inserts a document; an array is inserted item by item inserted_ids, count
db_find Query by filter with sorting and paging docs, count
db_find_one The first matching document doc, found
db_count How many documents match the filter count
db_update Updates by filter, supports upsert and multi matched, modified, upserted_id
db_delete Deletes by filter deleted

The collection is picked from a dropdown in the Collection field, not typed by hand.

Filters and updates

A filter is a subset of the MongoDB query language. You get the comparison operators $eq, $ne, $gt, $gte, $lt, $lte; membership $in, $nin; the logical $and, $or, $not, $nor; plus $exists, $size and $regex. Nested fields are addressed with dots — user.name, tags.0.

An update expression understands $set, $unset, $inc, $mul, $min, $max, $push, $pull, $addToSet.

{ "status": "pending", "total": { "$gte": 1000 } }

In db_find sorting is a list of field/direction pairs ([["created_at", -1]], where 1 is ascending and -1 descending); limit defaults to 100, and there are skip and projection (1 includes a field, 0 excludes it).

Port versus field

A value arriving on the node’s input port replaces the filter (or the document) configured in the fields. When the edge delivers nothing — and an empty string from an execution-only trigger counts as nothing — the configured value stays. A value of the wrong shape fails the node with a clear error instead of turning into “match everything”.

db_update also accepts an envelope on the port, {"filter": …, "update": …}; any other object is read as the filter.

Quota

Collection size is counted in bytes and meets two ceilings at once: the workspace’s own ceiling and the owner’s plan ceiling, which is measured across every workspace they own. Next to it sits a limit on the number of collections. Current usage is shown in the collection header (“used”) and under Settings → Usage; the limits themselves are in Plan limits.