{"_id":"typed-mongo","_rev":"6-a39e6f20f0950b3879862787848b6492","name":"typed-mongo","dist-tags":{"latest":"0.0.7"},"versions":{"0.0.1":{"name":"typed-mongo","version":"0.0.1","keywords":["oidc","trusted-publishing","setup"],"_id":"typed-mongo@0.0.1","maintainers":[{"name":"tmonoi","email":"t.thingwell@gmail.com"}],"dist":{"shasum":"3b56bfcb14db5be189e4094bafe56b7a7a8725fb","tarball":"https://registry.npmjs.org/typed-mongo/-/typed-mongo-0.0.1.tgz","fileCount":2,"integrity":"sha512-CiUTbMwMR8MVvRezsB9JxUtzGQsXcmClAKz9Wjc7AkoS1bhwkWI1n1esipwjY9odf1XiUbM/9JqKHOMt34M9cA==","signatures":[{"sig":"MEYCIQCzJ7TRLRT6uXmB+RGAdQ8a3k84UIeIQh8VHsMYGpar3gIhAK8JQHGVCQaZN7qs4cCxH3ap20D26e3YiRL+7gYtLwpj","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":2007},"_npmUser":{"name":"tmonoi","email":"t.thingwell@gmail.com"},"_npmVersion":"11.6.0","description":"OIDC trusted publishing setup package for typed-mongo","directories":{},"_nodeVersion":"24.8.0","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/typed-mongo_0.0.1_1758590538357_0.6196018462440906","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"typed-mongo","version":"0.0.3","keywords":["mongodb","typescript","schema","validation","type-safe","database"],"author":{"name":"tmonoi"},"license":"MIT","_id":"typed-mongo@0.0.3","maintainers":[{"name":"tmonoi","email":"t.thingwell@gmail.com"}],"homepage":"https://github.com/codatum/typed-mongo#readme","bugs":{"url":"https://github.com/codatum/typed-mongo/issues"},"dist":{"shasum":"f77755219c5994798b09c9a67d089069ac8286c9","tarball":"https://registry.npmjs.org/typed-mongo/-/typed-mongo-0.0.3.tgz","fileCount":7,"integrity":"sha512-yilOURtWXSBh0I+RJTev/Rw1yjRCM0LGlgsXuJQHD9R6CiN7N9TWJERzzQWUau/n8e2pdtzcABB00AYXefBirg==","signatures":[{"sig":"MEUCIQCHM/+i/gwip6b9yGcB24RDiS9b4z5LKCe5XtRhH3OKqgIgWjD0UewIYGhLu56NEkOFILV9bY82ELMgdIDR/gznx6A=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/typed-mongo@0.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46897},"main":"./dist/index.cjs","type":"module","_from":"file:typed-mongo-0.0.3.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"concurrently \"tsup --watch\" \"tsc -p tsconfig.build.json --emitDeclarationOnly --declaration --watch\"","lint":"biome check .","test":"vitest run --typecheck","build":"pnpm run clean && tsup","clean":"rm -rf dist","lint:fix":"biome check --apply .","clean:all":"pnpm run clean && rm -rf node_modules .turbo","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ca74a1b-0536-47c0-a1f4-e9997f6da964"}},"_resolved":"/tmp/059c8dd5f920585188f5d2139b68a3a6/typed-mongo-0.0.3.tgz","_integrity":"sha512-yilOURtWXSBh0I+RJTev/Rw1yjRCM0LGlgsXuJQHD9R6CiN7N9TWJERzzQWUau/n8e2pdtzcABB00AYXefBirg==","repository":{"url":"git+https://github.com/codatum/typed-mongo.git","type":"git"},"_npmVersion":"11.6.1","description":"A minimal, strongly-typed wrapper for the MongoDB Node.js driver.","directories":{},"sideEffects":false,"_nodeVersion":"22.19.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.76","tsup":"^8.0.1","vitest":"^1.1.0","mongodb":"^6.19.0","typescript":"^5.3.3","@types/node":"^20.10.0","concurrently":"^9.1.0","@biomejs/biome":"^1.4.1","mongodb-memory-server":"^9.1.4"},"peerDependencies":{"mongodb":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/typed-mongo_0.0.3_1758808420221_0.2950011224226512","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"typed-mongo","version":"0.0.4","keywords":["mongodb","typescript","schema","validation","type-safe","database"],"author":{"name":"tmonoi"},"license":"MIT","_id":"typed-mongo@0.0.4","maintainers":[{"name":"tmonoi","email":"t.thingwell@gmail.com"}],"homepage":"https://github.com/codatum/typed-mongo#readme","bugs":{"url":"https://github.com/codatum/typed-mongo/issues"},"dist":{"shasum":"c2df866c78af46a5cdaa6b910e1a11ec14338b05","tarball":"https://registry.npmjs.org/typed-mongo/-/typed-mongo-0.0.4.tgz","fileCount":7,"integrity":"sha512-vQFawCkcRY2hNYYQ3e8hjVb/hPGImJ7gxbhq5iSnm1CQagPwYUBWIXTd6XuZkA2P3vwio4WCFML7Wao4p9aPRQ==","signatures":[{"sig":"MEYCIQC1wEINClA4EgGCvK/DsBTM2MNaXEevCCPEm5JVBypm8gIhAMieszM1gPQHmCK+ED1bXFFNibYqiXnW0FPMlcYZq0BR","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/typed-mongo@0.0.4","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46108},"main":"./dist/index.cjs","type":"module","_from":"file:typed-mongo-0.0.4.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"concurrently \"tsup --watch\" \"tsc -p tsconfig.build.json --emitDeclarationOnly --declaration --watch\"","lint":"biome check .","test":"vitest run --typecheck","build":"pnpm run clean && tsup","clean":"rm -rf dist","lint:fix":"biome check --apply .","clean:all":"pnpm run clean && rm -rf node_modules .turbo","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ca74a1b-0536-47c0-a1f4-e9997f6da964"}},"_resolved":"/tmp/5732187f2f98830b7591374beb2b5455/typed-mongo-0.0.4.tgz","_integrity":"sha512-vQFawCkcRY2hNYYQ3e8hjVb/hPGImJ7gxbhq5iSnm1CQagPwYUBWIXTd6XuZkA2P3vwio4WCFML7Wao4p9aPRQ==","repository":{"url":"git+https://github.com/codatum/typed-mongo.git","type":"git"},"_npmVersion":"11.6.1","description":"A minimal, strongly-typed wrapper for the MongoDB Node.js driver.","directories":{},"sideEffects":false,"_nodeVersion":"22.19.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.76","tsup":"^8.0.1","vitest":"^1.1.0","mongodb":"^6.19.0","typescript":"^5.3.3","@types/node":"^20.10.0","concurrently":"^9.1.0","@biomejs/biome":"^1.4.1","mongodb-memory-server":"^9.1.4"},"peerDependencies":{"mongodb":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/typed-mongo_0.0.4_1758810902673_0.3069990616727287","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"typed-mongo","version":"0.0.5","keywords":["mongodb","typescript","schema","validation","type-safe","database"],"author":{"name":"tmonoi"},"license":"MIT","_id":"typed-mongo@0.0.5","maintainers":[{"name":"tmonoi","email":"t.thingwell@gmail.com"}],"homepage":"https://github.com/codatum/typed-mongo#readme","bugs":{"url":"https://github.com/codatum/typed-mongo/issues"},"dist":{"shasum":"ef2cd798b66c9b62849b005cfbe7d0f1c060e6b7","tarball":"https://registry.npmjs.org/typed-mongo/-/typed-mongo-0.0.5.tgz","fileCount":7,"integrity":"sha512-PAKwWTpwlNwrG1VNh4485Urv2KHHZp2c8FcUuFERornRjlRtNJDYRugda8kOxpl2ZTC+xqYMAg6snACIRoGjIg==","signatures":[{"sig":"MEUCIB5uM/0n3m9cCBTv7TiyeXAR5yolZ7rcPeIMuz5Wk6UqAiEAgxTFKpVNFgPJzNg8xZUm5IMXEGq9NGv58BmgeAEpMBc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/typed-mongo@0.0.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":45475},"main":"./dist/index.cjs","type":"module","_from":"file:typed-mongo-0.0.5.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"concurrently \"tsup --watch\" \"tsc -p tsconfig.build.json --emitDeclarationOnly --declaration --watch\"","lint":"biome check .","test":"vitest run --typecheck","build":"pnpm run clean && tsup","clean":"rm -rf dist","lint:fix":"biome check --apply .","clean:all":"pnpm run clean && rm -rf node_modules .turbo","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ca74a1b-0536-47c0-a1f4-e9997f6da964"}},"_resolved":"/tmp/f3e15ce322d02f639ca7e28386feaab6/typed-mongo-0.0.5.tgz","_integrity":"sha512-PAKwWTpwlNwrG1VNh4485Urv2KHHZp2c8FcUuFERornRjlRtNJDYRugda8kOxpl2ZTC+xqYMAg6snACIRoGjIg==","repository":{"url":"git+https://github.com/codatum/typed-mongo.git","type":"git"},"_npmVersion":"11.6.1","description":"A minimal, strongly-typed wrapper for the MongoDB Node.js driver.","directories":{},"sideEffects":false,"_nodeVersion":"22.19.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.76","tsup":"^8.0.1","vitest":"^1.1.0","mongodb":"^6.19.0","typescript":"^5.3.3","@types/node":"^20.10.0","concurrently":"^9.1.0","@biomejs/biome":"^1.4.1","mongodb-memory-server":"^9.1.4"},"peerDependencies":{"mongodb":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/typed-mongo_0.0.5_1759123149598_0.37164439637040103","host":"s3://npm-registry-packages-npm-production"}},"0.0.6":{"name":"typed-mongo","version":"0.0.6","keywords":["mongodb","typescript","schema","validation","type-safe","database"],"author":{"name":"tmonoi"},"license":"MIT","_id":"typed-mongo@0.0.6","maintainers":[{"name":"tmonoi","email":"t.thingwell@gmail.com"}],"homepage":"https://github.com/codatum/typed-mongo#readme","bugs":{"url":"https://github.com/codatum/typed-mongo/issues"},"dist":{"shasum":"6565d61e767869425cc2360322c01f35c447859e","tarball":"https://registry.npmjs.org/typed-mongo/-/typed-mongo-0.0.6.tgz","fileCount":7,"integrity":"sha512-eUwYL3Q30nXCgAybBrj6icLwt0ojzfsQ3AtU+6/3NJJSJEeXx5H4Ay/d921xzG0DyYH9Z6Pt/7PQqFC7whTEUQ==","signatures":[{"sig":"MEQCIFU4Y4r+6wsyPC4UlRBWTVCmwTiH7a6OIqRJ1bUDKmWxAiANx2yjtGE7DG3vXuGmEcQ1lHLebwKxWI1akd1g0vG2JQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/typed-mongo@0.0.6","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":54995},"main":"./dist/index.cjs","type":"module","_from":"file:typed-mongo-0.0.6.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"concurrently \"tsup --watch\" \"tsc -p tsconfig.build.json --emitDeclarationOnly --declaration --watch\"","lint":"biome check .","test":"vitest run --typecheck","build":"pnpm run clean && tsup","clean":"rm -rf dist","lint:fix":"biome check --apply .","clean:all":"pnpm run clean && rm -rf node_modules .turbo","typecheck":"tsc --noEmit","test:watch":"vitest","test:coverage":"vitest run --coverage"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ca74a1b-0536-47c0-a1f4-e9997f6da964"}},"_resolved":"/tmp/6cdc8f539f3887ed18fe94cbdc866182/typed-mongo-0.0.6.tgz","_integrity":"sha512-eUwYL3Q30nXCgAybBrj6icLwt0ojzfsQ3AtU+6/3NJJSJEeXx5H4Ay/d921xzG0DyYH9Z6Pt/7PQqFC7whTEUQ==","repository":{"url":"git+https://github.com/codatum/typed-mongo.git","type":"git"},"_npmVersion":"11.6.2","description":"A minimal, strongly-typed wrapper for the MongoDB Node.js driver.","directories":{},"sideEffects":false,"_nodeVersion":"22.20.0","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^3.25.76","tsup":"^8.0.1","vitest":"^1.1.0","mongodb":"^6.19.0","typescript":"^5.3.3","@types/node":"^20.10.0","concurrently":"^9.1.0","@biomejs/biome":"^1.4.1","mongodb-memory-server":"^9.1.4"},"peerDependencies":{"mongodb":"^6.0.0"},"_npmOperationalInternal":{"tmp":"tmp/typed-mongo_0.0.6_1760064163091_0.6741334786193982","host":"s3://npm-registry-packages-npm-production"}},"0.0.7":{"name":"typed-mongo","version":"0.0.7","description":"A minimal, strongly-typed wrapper for the MongoDB Node.js driver.","type":"module","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","keywords":["mongodb","typescript","schema","validation","type-safe","database"],"author":{"name":"tmonoi"},"license":"MIT","engines":{"node":">=22.0.0"},"peerDependencies":{"mongodb":"^6.0.0"},"devDependencies":{"@biomejs/biome":"^1.4.1","@types/node":"^20.10.0","concurrently":"^9.1.0","mongodb":"^6.19.0","mongodb-memory-server":"^9.1.4","tsup":"^8.0.1","typescript":"^5.3.3","vitest":"^1.1.0","zod":"^3.25.76"},"repository":{"type":"git","url":"git+https://github.com/codatum/typed-mongo.git"},"bugs":{"url":"https://github.com/codatum/typed-mongo/issues"},"homepage":"https://github.com/codatum/typed-mongo#readme","sideEffects":false,"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/","provenance":true},"scripts":{"build":"pnpm run clean && tsup","dev":"concurrently \"tsup --watch\" \"tsc -p tsconfig.build.json --emitDeclarationOnly --declaration --watch\"","test":"vitest run --typecheck","test:watch":"vitest","test:coverage":"vitest run --coverage","lint":"biome check .","lint:fix":"biome check --apply .","typecheck":"tsc --noEmit","clean:all":"pnpm run clean && rm -rf node_modules .turbo","clean":"rm -rf dist"},"_id":"typed-mongo@0.0.7","_integrity":"sha512-Ly32RDIJV7xbFggW7ay37Rbn4puEaN0rVabUk1HSo5R1E12PlboWzlcJm2X7WH0EjhK2ElreuF4YzoPbEZd/qA==","_resolved":"/tmp/3ff4956ba60036ddd3ceae3eca76e450/typed-mongo-0.0.7.tgz","_from":"file:typed-mongo-0.0.7.tgz","_nodeVersion":"22.20.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-Ly32RDIJV7xbFggW7ay37Rbn4puEaN0rVabUk1HSo5R1E12PlboWzlcJm2X7WH0EjhK2ElreuF4YzoPbEZd/qA==","shasum":"2d1367134309dd6e50f782343590b00035b77f35","tarball":"https://registry.npmjs.org/typed-mongo/-/typed-mongo-0.0.7.tgz","fileCount":7,"unpackedSize":55753,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/typed-mongo@0.0.7","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE0gL9XXQipSSMnTuw2uZ6JyNFiv40nvLK7pu/hg1Qs4AiA8APrjs0hwkxB8nZk0TPzFG4CzhxgJEX5QhLOJLUiNyg=="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1ca74a1b-0536-47c0-a1f4-e9997f6da964"}},"directories":{},"maintainers":[{"name":"tmonoi","email":"t.thingwell@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/typed-mongo_0.0.7_1760257874367_0.8080952349745691"},"_hasShrinkwrap":false}},"time":{"created":"2025-09-23T01:22:18.356Z","modified":"2025-10-12T08:31:15.006Z","0.0.1":"2025-09-23T01:22:18.541Z","0.0.3":"2025-09-25T13:53:40.414Z","0.0.4":"2025-09-25T14:35:02.900Z","0.0.5":"2025-09-29T05:19:09.764Z","0.0.6":"2025-10-10T02:42:43.287Z","0.0.7":"2025-10-12T08:31:14.550Z"},"bugs":{"url":"https://github.com/codatum/typed-mongo/issues"},"author":{"name":"tmonoi"},"license":"MIT","homepage":"https://github.com/codatum/typed-mongo#readme","keywords":["mongodb","typescript","schema","validation","type-safe","database"],"repository":{"type":"git","url":"git+https://github.com/codatum/typed-mongo.git"},"description":"A minimal, strongly-typed wrapper for the MongoDB Node.js driver.","maintainers":[{"name":"tmonoi","email":"t.thingwell@gmail.com"}],"readme":"# typed-mongo\n\n[![CI](https://github.com/codatum/typed-mongo/actions/workflows/ci.yml/badge.svg)](https://github.com/codatum/typed-mongo/actions/workflows/ci.yml)\n[![npm version](https://badge.fury.io/js/typed-mongo.svg)](https://badge.fury.io/js/typed-mongo)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n**typed-mongo** is an extremely thin wrapper for the MongoDB Node.js driver that provides powerful type inference and declarative index creation while maintaining the performance of the original MongoDB client. Inspired by the [papr](https://github.com/plexinc/papr) library, typed-mongo takes a similar approach but focuses on simplicity and performance.\n\n## Features\n\n- 🔄 Extremely thin wrapper around the MongoDB Node.js driver\n- 🎯 Smart type inference\n- 🔄 No custom schema definitions required\n- ⚡ Superior performance\n- 📝 Declarative index creation\n\n## Installation\n\n```bash\nnpm install typed-mongo\n# or\npnpm add typed-mongo\n# or\nyarn add typed-mongo\n```\n\n## Basic Usage\n\n```typescript\nimport { MongoClient, ObjectId } from 'mongodb';\nimport { TypedMongo } from 'typed-mongo';\n\n// Define your schema\ntype UserSchema = {\n  _id: ObjectId;\n  name: string;\n  age: number;\n  email?: string;\n  profile?: {\n    bio: string;\n    avatar?: string;\n  };\n};\n\n// Connect to MongoDB\nconst mongoClient = new MongoClient('mongodb://localhost:27017', { ignoreUndefined: true });\nawait mongoClient.connect();\nconst db = mongoClient.db('myapp');\n\n// Initialize typed-mongo\nconst typedMongo = new TypedMongo(db);\n\n// Create a type-safe model\nconst User = typedMongo.model<UserSchema>('users');\n\n// Insert a document with type-safe\nawait User.insertOne({\n  name: 'Alice',\n  age: 25,\n  email: 'alice@example.com'\n});\n\n// user is typed as UserSchema | null\nconst user = await User.findOne({ name: 'Alice' });\n\n// usersWithProjection is typed as { _id: ObjectId; name: string; }[]\nconst usersWithProjection = await User.find(\n  {},\n  { projection: { name: 1 } }\n);\n```\n\n## Type Error Examples\n\nTypeScript will catch these errors at compile time:\n\n```typescript\n// ❌ Type error: non-existent field\nawait User.findOne({ \n  nonExistentField: 'value' \n});\n// Error: 'nonExistentField' does not exist in type UserSchema\n\n// ❌ Type error: wrong type\nawait User.findOne({ \n  age: 'thirty' // age should be number\n});\n// Error: Type 'string' is not assignable to type 'number'\n\n// ❌ Type error: missing required field\nawait User.insertOne({\n  _id: 'user1',\n  // name field is missing\n  age: 25\n});\n// Error: Property 'name' is missing\n```\n\n## Index Management\n\ntyped-mongo provides declarative index creation.  \n\n```typescript\nconst User = typedMongo.model<UserSchema>('users', {\n  indexes: [\n    { key: { email: 1 }, unique: true },\n    { key: { name: 1 } },\n  ]\n});\n\n// Create indexes and drop obsolete ones (Recommended)\nawait User.syncIndexes({ dropObsolete: true });\n\n// Sync indexes (safe: only creates new indexes, never drops)\nawait User.syncIndexes();\n\n// otherwise, you can sync indexes for all models\nawait typedMongo.syncIndexes({ dropObsolete: true });\n```\n\n## API Reference\n\n### TypedMongo\n\n```typescript\nconst typedMongo = new TypedMongo(db: Db);\n```\n\n#### Methods\n\n- `model<TSchema>(collectionName: string, options?: ModelOptions)` - Create a type-safe model\n- `syncIndexes(options?)` - Synchronize indexes for all registered models\n- `getModels()` - Get all registered models\n- `getDb()` - Get the underlying MongoDB database instance\n\n### Model\n\nModels provide the following methods:\n\n- `findOne(filter, options?)` - Find a single document\n- `findCursor(filter, options?)` - Returns a cursor (MongoDB standard)\n- `find(filter, options?)` - Find multiple documents as an array\n- `insertOne(doc, options?)` - Insert a single document\n- `insertMany(docs, options?)` - Insert multiple documents\n- `updateOne(filter, update, options?)` - Update a single document\n- `updateMany(filter, update, options?)` - Update multiple documents\n- `replaceOne(filter, replacement, options?)` - Replace a document\n- `deleteOne(filter, options?)` - Delete a single document\n- `deleteMany(filter, options?)` - Delete multiple documents\n- `findOneAndUpdate(filter, update, options?)` - Find and update\n- `findOneAndReplace(filter, replacement, options?)` - Find and replace\n- `findOneAndDelete(filter, options?)` - Find and delete\n- `countDocuments(filter?, options?)` - Count documents\n- `distinct(key, filter?, options?)` - Get distinct values\n- `aggregate(pipeline, options?)` - Aggregation pipeline\n- `bulkWrite(operations, options?)` - Bulk write operations\n- `syncIndexes(options?)` - Synchronize indexes for this model\n- `getCollection()` - Get the underlying MongoDB collection\n\n## Performance\n\ntyped-mongo is designed as a thin wrapper around the MongoDB native driver, providing superior performance compared to heavy ORMs like Mongoose:\n\n- **Minimal overhead**: No unnecessary abstraction layers\n- **Native MongoDB performance**: Near-native driver speed\n- **Memory efficient**: No additional schema validation or middleware overhead\n\n## Why Choose typed-mongo?\n\n### vs Mongoose\n- ✅ Better performance\n- ✅ Superior type inference\n- ✅ Smaller bundle size\n- ✅ No duplicate schema definitions\n\n### vs Native MongoDB Driver\n- ✅ Full type safety\n- ✅ Better developer experience\n- ✅ Early type error detection\n- ✅ IDE autocomplete support\n\n## Trusted by\n\n<p align=\"center\">\n  <a href=\"https://codatum.com\">\n    <img src=\"https://storage.googleapis.com/prod-cdm-public2/assets/invite_mail_logo.png\" alt=\"Codatum\" height=\"50\">\n  </a>\n</p>\n\ntyped-mongo is trusted by [Codatum](https://codatum.com).\n\n## License\n\nMIT\n\n## Contributing\n\nPull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.\n\n## Support\n\nIf you encounter any issues or have feature requests, please open an issue on [GitHub](https://github.com/codatum/typed-mongo/issues).","readmeFilename":"README.md"}