Node CLI
A CLI tool using ctrodb in Node
The Node example is a Node.js script that uses ctrodb with the Memory adapter and FTS search.
Running it
node examples/node/index.mjs
What it shows
- Using ctrodb in Node.js (Memory adapter auto-selected)
- Schema with validated fields (email format)
- FTS plugin with searchable fields
- CRUD operations on
usersandarticles - FTS search on article titles
Key code
import { Database, ftsPlugin } from "ctrodb"
const db = new Database({
schema: {
version: 1,
collections: {
articles: {
fields: {
title: { type: "string" },
body: { type: "string" },
},
searchable: ["title"],
},
},
},
plugins: [ftsPlugin()],
})
await db.connect()
const articles = db.collection("articles")
await articles.create({ title: "Hello World", body: "..." })
const found = await articles.query().search("title", "hello").fetch()How is this guide?
Last updated on Jun 20, 2026