# storage.query

Canonical URL: https://developers.iagenify.com/pt/sdk/workflows/steps/storage-query/
Language: pt

`type: "storage.query"`

Legge una base di dati o cubo collegado. Le stesse azioni di run(), dentro una catena.

Status: free · storage required · read only

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `storage` | string | obrigatório | Identificant del stoccaj. |
| `action` | string |  | `find`, `count`, `aggregate`, `collections`, `list`, `object`, `overview`... |
| `sql` | string |  | Per un stoccaggio relatial, in lugar de `action`. |

Un di `action` e `sql` is necessarisitâts. Tutto il resto — `collection`, `filter`, `limit`, `prefix`, `key` — segue l'azione, esattamente come in [run()](/pt/sdk/ref/connected-storage/run).

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

## Saída {#output}

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

## Lege solamente {#readonly}

Scrivitura è [storage.write](/pt/sdk/workflows/steps/storage-write), un tipo diverso con i suoi propri guardas. Una catena data solo a questo non può modificar nulla, qualunque chestione dis.

## vista general quando si sta construindo {#overview}

Rule once once with [runStep()](/pt/sdk/ref/workflow/run-step) per vedere le collezioni, i loro campi e un esempio real — e scrivi la consulta che segue con le forme in davanti a te.

- [storage.write](/pt/sdk/workflows/steps/storage-write): - Cambiandolo.
- [run()](/pt/sdk/ref/connected-storage/run): Le medesime azioni.
- [Etapas do fluxo de trabalho](/pt/sdk/workflows/steps): Os 23 tipos.

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

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