# collections

Canonical URL: https://developers.iagenify.com/pt/sdk/ref/connected-storage/run/collections/
Language: pt

`storage.run({ action: "collections" })`

Ogni collezion in una base de dati documental, con quanti documenti cada uno detiene.

Status: document database · free · no collection needed

Una delle due azioni che lavorano sulla base di dati invece di una collezion — non c'è `collection` a passare. L'altra è [overview](/pt/sdk/ref/connected-storage/run/overview).

```javascript
await storage.run({ action: "collections" });
// [{ name: "users", count: 1204 }, { name: "orders", count: 88311 }]
```

## La conta è una stima {#counts}

> **Legga da metadat, non camminando i documenti**
>
> Una conta esa su una grande collezion significa lectèa. Per una cifra che si agisce, use con un filtro; per «aproximatamente quanta grande è questo», la estimazione è ciò che si desidera e è gratuita.

## Collecciona di sistema sono oltrati {#system}

Colleczioni interne sono filtrate, quindi il che torna è quello che si pone là. Una colleczion create e non pot vee aquí è un segno che si è connextu a una base di dati differente — veda il percorso URI on [connect()](/pt/sdk/ref/storage/connect).

```javascript
const collections = await storage.run({ action: "collections" });

if (!collections.length) {
  // Either it is empty, or the connection landed on the wrong database.
  // The database is read from the path of the URI: …/mydb
}
```

- [Schema](/pt/sdk/ref/connected-storage/run/schema): Ce qu'il y a dans une collection, campagnol par campagnol.
- [run()](/pt/sdk/ref/connected-storage/run): Tutes les actions, les garde-fous et ce que chaque coute.

```python
storage.run(action="collections")
# [{"name": "users", "count": 1204}, {"name": "orders", "count": 88311}]
```

```python
collections = storage.run(action="collections")

if not collections:
    # Either it is empty, or the connection landed on the wrong database.
    # The database is read from the path of the URI: …/mydb
    pass
```
