import { NexusDB } from "@nexusdb/sdk";
// Connect to your database
const db = new NexusDB({
url: "https://your-instance.nexusdb.io",
apiKey: process.env.NEXUSDB_API_KEY,
});
// Create a collection
await db.createCollection("users");
// Insert a document
const user = await db.insert("users", {
name: "Jane Doe",
email: "jane@example.com",
role: "admin",
createdAt: new Date(),
});
// Query with filters
const admins = await db.find("users", {
where: { role: "admin" },
sort: { createdAt: "desc" },
limit: 10,
});
console.log(admins);First-class SDKs with native async support, connection pooling, and type-safe APIs.
From the command line to your favorite editor, we've got you covered.
Step-by-step tutorials to help you master NexusDB.