NotDatabase
Docs
A document is a single unit of data inside a collection — like a row in SQL or an object in a JSON array.
In NotDatabase, documents are just structured key-value objects that follow your collection's schema.
Use the .insert()
method to add a new document to a collection:
await db.users.insert({
name: "Jian-Yang",
email: "jianyang@piedpiper.com",
});
Every document automatically includes:
_id
: A unique identifier (you can override with key
)createdAt
: Timestamp of when the doc was createdupdatedAt
: Timestamp of last updateExample:
{
"_id": "abc123",
"name": "Jian-Yang",
"email": "jianyang@piedpiper.com",
"createdAt": "2025-06-19T12:00:00Z",
"updatedAt": "2025-06-19T12:00:00Z"
}