NotDatabase
Docs
A collection is a group of related documents — like a table in SQL, or a model in an ORM.
Each collection is defined by a schema that describes the shape of the data it holds.
You define collections inside the schema
object when initializing your client:
const db = createClient({
apiKey: "your_api_key",
schema: {
users: {
properties: {
name: { type: "string", required: true },
email: { type: "string", required: true, unique: true },
isAdmin: { type: "boolean", default: false },
},
},
},
});
This creates a users
collection with three fields:
name
(required string)email
(required string, unique)isAdmin
(optional boolean with a default)Unlike traditional NoSQL databases, NotDatabase enforces your schema. That means:
You don't need to write validation logic — it's all automatic.
Each collection has a single schema. If you update the schema, it applies to all documents going forward (past documents are untouched unless updated).
You can define fields as required
or unique
:
email: { type: "string", required: true, unique: true }
NotDatabase will:
email
is missingemail
already exists