# Scan and Vector Commands

This page covers the ToriiDB commands that scan many keys (`KEYS`, `FIND`, `QUERY`) and the vector commands (`VSEARCH`, `VSIM`, `VGET`).

## KEYS, FIND, QUERY

```text
KEYS user:*
FIND like *database* LIMIT 10
QUERY profile.level >= 3 AND active = true LIMIT 20
```

| Command | Notes |
|---|---|
| `KEYS` | Go `path.Match` glob, sorted |
| `FIND` | Invalid operator → `error: operator must be eq, ne, gt, gte/ge, lt, lte/le, or like` |
| `QUERY` | Parse errors → `error: <message>` |

Operators are in [Operators and FIND](/querying-operators); the expression grammar is in [QUERY Expressions](/querying-query).

## Vector Commands

```text
VSEARCH <text> [MATCH <pattern>] [LIMIT <n>]
VSIM <key1> <key2>
VGET <key>
```

| Command | Notes |
|---|---|
| `VSEARCH` | `MATCH` and `LIMIT` may come in either order at the end; default limit `10`; errors print `error: <message>` |
| `VSIM` | `(nil)` when a key or vector is missing; `error: vector is mismatch: a vs b` for different lengths |
| `VGET` | `(nil)` when the key has no vector |

## Related Pages

- [Operators and FIND](/querying-operators)
- [QUERY Expressions](/querying-query)
- [VSEARCH and VSIM](/vector-search-query)
