Workflow steps

storage.query

type: "storage.query"

Reads a connected database or bucket. The same actions as run(), inside a chain.

freestorage requiredread only
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

storagestringrequired

The storage's identifier.

actionstring

find, count, aggregate, collections, list, object, overview…

sqlstring

For a relational storage, instead of action.

One of action and sql is required. Everything else — collection, filter, limit, prefix, key — follows the action, exactly as in run().

{ id: "read", type: "storage.query", config: {
    storage: "…", action: "find", collection: "posts",
    filter: { createdAt: { $gte: "{{input.since}}" } }, options: { limit: 50 } } }
{"id": "read", "type": "storage.query", "config": {
    "storage": "…", "action": "find", "collection": "posts",
    "filter": {"createdAt": {"$gte": "{{input.since}}"}}, "options": {"limit": 50}}}

Output

{{steps.read.output.result}}     // what the action returned
{{steps.read.output.storage}}    // the storage's label
{{steps.read.output.provider}}
"{{steps.read.output.result}}"     # what the action returned
"{{steps.read.output.storage}}"    # the storage's label
"{{steps.read.output.provider}}"

It only reads

Writing is storage.write, a different type with its own guards. A chain given only this one cannot modify anything, whatever its templates say.

overview when you are building

Run it once with runStep() to see the collections, their fields and a real example — then write the query that follows with the shapes in front of you.