v0.7.0

Scan and Vector Commands

Last updated


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

KEYS, FIND, QUERY


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

CommandNotes
KEYSGo path.Match glob, sorted
FINDInvalid operator → error: operator must be eq, ne, gt, gte/ge, lt, lte/le, or like
QUERYParse errors → error: <message>

Operators are in Operators and FIND; the expression grammar is in QUERY Expressions.

Vector Commands


  1. VSEARCH <text> [MATCH <pattern>] [LIMIT <n>]
  2. VSIM <key1> <key2>
  3. VGET <key>

CommandNotes
VSEARCHMATCH 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


中文