···2323## 📦 Installation
24242525```bash
2626-npm install mizzleorm mongodb zod
2727-# or
2828-yarn add mizzleorm mongodb zod
2626+deno add jsr:@nozzle/db
2927```
30283129> If you need to upgrade your local MongoDB server, see:
···11import { z } from "zod";
22+import { ObjectId } from "mongodb";
23import {
34 connect,
45 defineModel,
56 disconnect,
66- InferModel,
77- InsertType,
88- MongoModel,
99-} from "../src";
1010-import { ObjectId } from "mongodb";
77+ type InferModel,
88+ type InsertType,
99+ Model,
1010+} from "../mod.ts";
11111212// 1. Define your schema using Zod
1313const userSchema = defineModel(z.object({
···2424async function runExample() {
2525 try {
2626 // 3. Connect to MongoDB
2727- await connect("mongodb://localhost:27017", "mizzleorm_example");
2727+ await connect("mongodb://localhost:27017", "nozzle_example");
2828 console.log("Connected to MongoDB");
29293030- // 2. Create a MongoModel for your collection
3131- const UserModel = new MongoModel("users", userSchema);
3030+ // 2. Create a Model for your collection
3131+ const UserModel = new Model("users", userSchema);
32323333 // Clean up previous data
3434 await UserModel.delete({});
···7676 }
7777}
78787979-runExample();
7979+// Only run the example if this is the main module
8080+if (import.meta.main) {
8181+ runExample();
8282+}