Skip to content

Quickstart

Once you’ve installed filedb and filedb-cli, you’re ready to go.

Terminal window
filedb serve --data ./data --api-key dev-key

This opens gRPC on :5433, the REST gateway on :8080, and a Unix socket at /tmp/filedb.sock (which the CLI prefers when it’s local).

Terminal window
filedb-cli insert users '{"name":"alice","age":30}' --api-key dev-key

Every record comes back with an id, a caller-visible key, and a monotonic rev.

Filters are small JSON objects (field / op / value):

Terminal window
filedb-cli find users '{"field":"name","op":"eq","value":"alice"}' --api-key dev-key
filedb-cli find users '{"field":"age","op":"gt","value":18}' --api-key dev-key

Anything the CLI can do is also available over HTTP on :8080:

Terminal window
curl -H "x-api-key: dev-key" \
-d '{"data":{"name":"bob","age":41}}' \
http://localhost:8080/v1/users/records

For interactive exploration:

Terminal window
filedb-cli repl --api-key dev-key
filedb> use users
filedb> insert {"name":"carol","age":27}
filedb> find {"field":"age","op":"lt","value":30}
filedb> aggregate --field age --aggs count,avg

Your data now lives in ./data/users/ as append-only NDJSON — go ahead and cat it. From here: