Thin MongoDB ODM built for Standard Schema
mongodb zod deno

readme updates

+4 -39
+3 -38
README.md
··· 23 23 ## 📦 Installation 24 24 25 25 ```bash 26 - deno add jsr:@nozzle/db 26 + deno add jsr:@nozzle/nozzle 27 27 ``` 28 28 29 29 > If you need to upgrade your local MongoDB server, see: ··· 42 42 43 43 export const userSchema = z.object({ 44 44 name: z.string(), 45 - email: z.string().email(), 45 + email: z.email(), 46 46 age: z.number().int().positive().optional(), 47 47 createdAt: z.date().default(() => new Date()), 48 48 }); ··· 62 62 InferModel, 63 63 InsertType, 64 64 MongoModel, 65 - } from "mizzleorm"; 65 + } from "@nozzle/nozzle"; 66 66 import { userSchema } from "./schemas/user"; 67 67 import { ObjectId } from "mongodb"; // v6+ driver recommended 68 68 ··· 145 145 { age: { $gte: 18 } }, 146 146 { skip: 0, limit: 10, sort: { age: -1 } }, 147 147 ); 148 - ``` 149 - 150 - --- 151 - 152 - ## 🧠 Project Structure 153 - 154 - ``` 155 - mizzleorm/ 156 - ├── src/ 157 - │ ├── schema.ts # Schema definition utility 158 - │ ├── model.ts # MongoModel wrapper 159 - │ ├── client.ts # MongoDB client connection 160 - │ └── index.ts # Public API exports 161 - ├── examples/ # Example usage files 162 - │ └── user.ts 163 - ├── tests/ # Unit and integration tests 164 - ├── package.json 165 - ├── tsconfig.json 166 - └── README.md 167 - ``` 168 - 169 - --- 170 - 171 - ## 🛠 Development 172 - 173 - ### Build the library: 174 - 175 - ```bash 176 - npm run build 177 - ``` 178 - 179 - ### Run the example: 180 - 181 - ```bash 182 - npm run example 183 148 ``` 184 149 185 150 ---
+1 -1
examples/user.ts
··· 11 11 // 1. Define your schema using Zod 12 12 const userSchema = z.object({ 13 13 name: z.string(), 14 - email: z.string().email(), 14 + email: z.email(), 15 15 age: z.number().int().positive().optional(), 16 16 createdAt: z.date().default(() => new Date()), 17 17 });