Thin MongoDB ODM built for Standard Schema
mongodb zod deno

readme updates

+4 -39
+3 -38
README.md
··· 23 ## ๐Ÿ“ฆ Installation 24 25 ```bash 26 - deno add jsr:@nozzle/db 27 ``` 28 29 > If you need to upgrade your local MongoDB server, see: ··· 42 43 export const userSchema = z.object({ 44 name: z.string(), 45 - email: z.string().email(), 46 age: z.number().int().positive().optional(), 47 createdAt: z.date().default(() => new Date()), 48 }); ··· 62 InferModel, 63 InsertType, 64 MongoModel, 65 - } from "mizzleorm"; 66 import { userSchema } from "./schemas/user"; 67 import { ObjectId } from "mongodb"; // v6+ driver recommended 68 ··· 145 { age: { $gte: 18 } }, 146 { skip: 0, limit: 10, sort: { age: -1 } }, 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 ``` 184 185 ---
··· 23 ## ๐Ÿ“ฆ Installation 24 25 ```bash 26 + deno add jsr:@nozzle/nozzle 27 ``` 28 29 > If you need to upgrade your local MongoDB server, see: ··· 42 43 export const userSchema = z.object({ 44 name: z.string(), 45 + email: z.email(), 46 age: z.number().int().positive().optional(), 47 createdAt: z.date().default(() => new Date()), 48 }); ··· 62 InferModel, 63 InsertType, 64 MongoModel, 65 + } from "@nozzle/nozzle"; 66 import { userSchema } from "./schemas/user"; 67 import { ObjectId } from "mongodb"; // v6+ driver recommended 68 ··· 145 { age: { $gte: 18 } }, 146 { skip: 0, limit: 10, sort: { age: -1 } }, 147 ); 148 ``` 149 150 ---
+1 -1
examples/user.ts
··· 11 // 1. Define your schema using Zod 12 const userSchema = z.object({ 13 name: z.string(), 14 - email: z.string().email(), 15 age: z.number().int().positive().optional(), 16 createdAt: z.date().default(() => new Date()), 17 });
··· 11 // 1. Define your schema using Zod 12 const userSchema = z.object({ 13 name: z.string(), 14 + email: z.email(), 15 age: z.number().int().positive().optional(), 16 createdAt: z.date().default(() => new Date()), 17 });