{"_id":"@airnauts/comments-adapter-mongo","_rev":"8-caec6a7b78c396cf87e3947d8ed11180","name":"@airnauts/comments-adapter-mongo","dist-tags":{"latest":"0.7.0"},"versions":{"0.1.0":{"name":"@airnauts/comments-adapter-mongo","version":"0.1.0","keywords":["comments","commenting","annotations","feedback","airnauts","mongodb","adapter"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-adapter-mongo@0.1.0","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"0040b101ae71e0945b4409174fc1c558ebd298b7","tarball":"https://registry.npmjs.org/@airnauts/comments-adapter-mongo/-/comments-adapter-mongo-0.1.0.tgz","fileCount":11,"integrity":"sha512-dmnr6ijbCULX6fxwJgsam90u+krgLxHj02winGjUEJSRcZdt20saeHMzq/yknkIHOC2nkdmc/Gb+WwUN1tZ5JQ==","signatures":[{"sig":"MEUCIQCkLpiHKBTKdyfUuRuDcSjbkaPAUjrSrMumtS/esqHLwAIgP64Qi+COoSApoZab141gOBYh54dlPCwmyVlMoA0VR5o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":25413},"type":"module","_from":"file:airnauts-comments-adapter-mongo-0.1.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/private/var/folders/2n/cymmpn8j3p962bjb2kqxq7n80000gn/T/0330fe73fe6ddecf0245a7bf9a5f9c2d/airnauts-comments-adapter-mongo-0.1.0.tgz","_integrity":"sha512-dmnr6ijbCULX6fxwJgsam90u+krgLxHj02winGjUEJSRcZdt20saeHMzq/yknkIHOC2nkdmc/Gb+WwUN1tZ5JQ==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/adapter-mongo"},"_npmVersion":"10.9.2","description":"MongoDB repository adapter for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.13.0","dependencies":{"mongodb":"^6.12.0","@airnauts/comments-core":"^0.1.0","@airnauts/comments-server":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongodb-memory-server":"^10.1.2","@airnauts/comments-test-support":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/comments-adapter-mongo_0.1.0_1780410887607_0.8474685375044877","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-adapter-mongo — install that instead. No longer maintained."},"0.2.0":{"name":"@airnauts/comments-adapter-mongo","version":"0.2.0","keywords":["comments","commenting","annotations","feedback","airnauts","mongodb","adapter"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-adapter-mongo@0.2.0","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"07462db576cc4ad44db6302edab667932980b014","tarball":"https://registry.npmjs.org/@airnauts/comments-adapter-mongo/-/comments-adapter-mongo-0.2.0.tgz","fileCount":11,"integrity":"sha512-ZD5ZSbobXjLswakapddKviepHu9Bg1kbKvgRNElhHY8sOqXmoNZ8QYaPUZF91y6ANnlVYSG6UrCEDyeN+WYbLA==","signatures":[{"sig":"MEUCIQDriLn8vYuQ4NpMkjq98vjpJrOkU26X44ZIDN2eGnH52wIgFv1dp9dBJShPgDcZnc/hwPozkR8wUE2ZUsLDQmBPeIw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26359},"type":"module","_from":"file:airnauts-comments-adapter-mongo-0.2.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/tmp/b90c606558570a6552d27f251ab45bd6/airnauts-comments-adapter-mongo-0.2.0.tgz","_integrity":"sha512-ZD5ZSbobXjLswakapddKviepHu9Bg1kbKvgRNElhHY8sOqXmoNZ8QYaPUZF91y6ANnlVYSG6UrCEDyeN+WYbLA==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/adapter-mongo"},"_npmVersion":"10.9.8","description":"MongoDB repository adapter for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"mongodb":"^6.12.0","@airnauts/comments-core":"^0.2.0","@airnauts/comments-server":"^0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongodb-memory-server":"^10.1.2","@airnauts/comments-test-support":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/comments-adapter-mongo_0.2.0_1780913165202_0.6894745446378696","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-adapter-mongo — install that instead. No longer maintained."},"0.4.0":{"name":"@airnauts/comments-adapter-mongo","version":"0.4.0","keywords":["comments","commenting","annotations","feedback","airnauts","mongodb","adapter"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-adapter-mongo@0.4.0","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"c17e3a36f28d567f7eacb2002cc551c814eb8641","tarball":"https://registry.npmjs.org/@airnauts/comments-adapter-mongo/-/comments-adapter-mongo-0.4.0.tgz","fileCount":11,"integrity":"sha512-LQEGRJCMchyiWDWn/w4oiseYrGRzqfNxLcz07LGe+nTQ8nTXWyo9jvMwc5NEUpG3zxDkUP0YemqR1GqWFf/uew==","signatures":[{"sig":"MEUCIQCvx14pXEgwqt3gnggBMneaKT1s+O+uR9dHRc8alLiqcgIgQ7TDeCF/MWFCKVLFQeB0SMjyy114iMsr/9uD0V7GqnI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26359},"type":"module","_from":"file:airnauts-comments-adapter-mongo-0.4.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/tmp/00b4563f6b6d2007e33b4052cbf45adc/airnauts-comments-adapter-mongo-0.4.0.tgz","_integrity":"sha512-LQEGRJCMchyiWDWn/w4oiseYrGRzqfNxLcz07LGe+nTQ8nTXWyo9jvMwc5NEUpG3zxDkUP0YemqR1GqWFf/uew==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/adapter-mongo"},"_npmVersion":"10.9.8","description":"MongoDB repository adapter for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"mongodb":"^6.12.0","@airnauts/comments-core":"^0.4.0","@airnauts/comments-server":"^0.4.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongodb-memory-server":"^10.1.2","@airnauts/comments-test-support":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/comments-adapter-mongo_0.4.0_1780915787570_0.4474204514903426","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-adapter-mongo — install that instead. No longer maintained."},"0.5.0":{"name":"@airnauts/comments-adapter-mongo","version":"0.5.0","keywords":["comments","commenting","annotations","feedback","airnauts","mongodb","adapter"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-adapter-mongo@0.5.0","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"6190340506ce45afbf04aaf69e87a18a22d5b403","tarball":"https://registry.npmjs.org/@airnauts/comments-adapter-mongo/-/comments-adapter-mongo-0.5.0.tgz","fileCount":11,"integrity":"sha512-7jyrFKSMxRIx9WcZTkvveEAmS3Il1Lgu+qhCedGYTgTIj/Vt+Rwv0JxNsA+07P51DJZnlqFJP+ZxSgsdqgiF2w==","signatures":[{"sig":"MEYCIQCVX6R1yh5pn/bJ3Ea+1Sa+vkU/+sX5U2qKK6Ffm4WSgwIhANYMvD/w8l5MsJ8xHVMxmtlIY0G6OCgNzXb9Mht/B8Ou","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26359},"type":"module","_from":"file:airnauts-comments-adapter-mongo-0.5.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/tmp/6ca782880e4e481c4eedf246c67e1f3e/airnauts-comments-adapter-mongo-0.5.0.tgz","_integrity":"sha512-7jyrFKSMxRIx9WcZTkvveEAmS3Il1Lgu+qhCedGYTgTIj/Vt+Rwv0JxNsA+07P51DJZnlqFJP+ZxSgsdqgiF2w==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/adapter-mongo"},"_npmVersion":"10.9.8","description":"MongoDB repository adapter for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"mongodb":"^6.12.0","@airnauts/comments-core":"^0.5.0","@airnauts/comments-server":"^0.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongodb-memory-server":"^10.1.2","@airnauts/comments-test-support":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/comments-adapter-mongo_0.5.0_1780919620612_0.8201859684468109","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-adapter-mongo — install that instead. No longer maintained."},"0.5.1":{"name":"@airnauts/comments-adapter-mongo","version":"0.5.1","keywords":["comments","commenting","annotations","feedback","airnauts","mongodb","adapter"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-adapter-mongo@0.5.1","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"6632977aea801e5d145d49497cd5a9329e20a138","tarball":"https://registry.npmjs.org/@airnauts/comments-adapter-mongo/-/comments-adapter-mongo-0.5.1.tgz","fileCount":11,"integrity":"sha512-DvWtRPgHwAfP0Rmzxq8mVVquEqCMzB6To6RHLzbciMvZxAt++o4iMYFu971gTA8beA+tHNGL4egfEyiTtft2EA==","signatures":[{"sig":"MEUCIQCTaTAL460XFY17Nhy9xKMAxHc5gmCh9Dnk+eGFj/jAowIgPtaPJuW8HjuVm1km8FGWBjUcpYIgu/UOCw/IOuykeA0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26359},"type":"module","_from":"file:airnauts-comments-adapter-mongo-0.5.1.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/tmp/20a56098fe568286f84b663b67cc0252/airnauts-comments-adapter-mongo-0.5.1.tgz","_integrity":"sha512-DvWtRPgHwAfP0Rmzxq8mVVquEqCMzB6To6RHLzbciMvZxAt++o4iMYFu971gTA8beA+tHNGL4egfEyiTtft2EA==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/adapter-mongo"},"_npmVersion":"10.9.8","description":"MongoDB repository adapter for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"mongodb":"^6.12.0","@airnauts/comments-core":"^0.5.1","@airnauts/comments-server":"^0.5.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongodb-memory-server":"^10.1.2","@airnauts/comments-test-support":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/comments-adapter-mongo_0.5.1_1780924735957_0.7142711706169194","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-adapter-mongo — install that instead. No longer maintained."},"0.6.0":{"name":"@airnauts/comments-adapter-mongo","version":"0.6.0","keywords":["comments","commenting","annotations","feedback","airnauts","mongodb","adapter"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-adapter-mongo@0.6.0","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"ab15eb6ffe90db0c4c1b297b9569952be47a9def","tarball":"https://registry.npmjs.org/@airnauts/comments-adapter-mongo/-/comments-adapter-mongo-0.6.0.tgz","fileCount":11,"integrity":"sha512-9+mA1bWGsHLx6ZtZmJALQgaC5Ub5YWxxMYKNCDEhn/IZePbAM4QnsLALJJrMEmtl8+Qmq3S260Wh093YNWZ2zQ==","signatures":[{"sig":"MEYCIQD0/1IhJ6c0nesmEqQFh3CiO6Bz5/ZBdB6wzLLn05J39gIhAPn56Ue6xIpEQJlNGtUHrxHaJH1xzOAIEydVHUu164s0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29709},"type":"module","_from":"file:airnauts-comments-adapter-mongo-0.6.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/tmp/1ca2facd80f515e0f00f41b63e8eabf6/airnauts-comments-adapter-mongo-0.6.0.tgz","_integrity":"sha512-9+mA1bWGsHLx6ZtZmJALQgaC5Ub5YWxxMYKNCDEhn/IZePbAM4QnsLALJJrMEmtl8+Qmq3S260Wh093YNWZ2zQ==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/adapter-mongo"},"_npmVersion":"10.9.8","description":"MongoDB repository adapter for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"mongodb":"^6.12.0","@airnauts/comments-core":"^0.6.0","@airnauts/comments-server":"^0.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongodb-memory-server":"^10.1.2","@airnauts/comments-next":"0.6.0","@airnauts/comments-test-support":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/comments-adapter-mongo_0.6.0_1781537514120_0.31562215241052183","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-adapter-mongo — install that instead. No longer maintained."},"0.7.0":{"name":"@airnauts/comments-adapter-mongo","version":"0.7.0","keywords":["comments","commenting","annotations","feedback","airnauts","mongodb","adapter"],"author":{"name":"Airnauts"},"license":"MIT","_id":"@airnauts/comments-adapter-mongo@0.7.0","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"homepage":"https://github.com/Airnauts/commenting-tool#readme","bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"dist":{"shasum":"84138bcb9e438b6d64460369074986fd877659ba","tarball":"https://registry.npmjs.org/@airnauts/comments-adapter-mongo/-/comments-adapter-mongo-0.7.0.tgz","fileCount":11,"integrity":"sha512-Y5B6bUuu7/M6hSKnycJ6eDoyuYaSbUR9SXerr1W8U3nfUdj256Pxn6kYi9f1RY5TbVbQNc8Kl6GRi9Mx498Xdg==","signatures":[{"sig":"MEYCIQD4htYejpn3SwwvACU3HD+US/5kB0+LE+OoiNSv0emaVAIhALOWFyY/SXOkK+J0OXrW9tO1PLdSfCBRaQr+P/cZW4JY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29709},"type":"module","_from":"file:airnauts-comments-adapter-mongo-0.7.0.tgz","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsup && tsc --build --force","typecheck":"tsc --build"},"_npmUser":{"name":"mateuszpaulski","email":"mateusz@airnauts.com"},"_resolved":"/tmp/fc48155307f0b8dcea333091a495c2ab/airnauts-comments-adapter-mongo-0.7.0.tgz","_integrity":"sha512-Y5B6bUuu7/M6hSKnycJ6eDoyuYaSbUR9SXerr1W8U3nfUdj256Pxn6kYi9f1RY5TbVbQNc8Kl6GRi9Mx498Xdg==","repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/adapter-mongo"},"_npmVersion":"10.9.8","description":"MongoDB repository adapter for the Airnauts commenting tool server.","directories":{},"_nodeVersion":"22.22.3","dependencies":{"mongodb":"^6.12.0","@airnauts/comments-core":"^0.7.0","@airnauts/comments-server":"^0.7.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongodb-memory-server":"^10.1.2","@airnauts/comments-next":"0.7.0","@airnauts/comments-test-support":"0.0.0"},"_npmOperationalInternal":{"tmp":"tmp/comments-adapter-mongo_0.7.0_1781540305111_0.5263529664871709","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @airnauts/airside-adapter-mongo — install that instead. No longer maintained."}},"time":{"created":"2026-06-02T14:34:47.481Z","modified":"2026-06-16T09:41:42.409Z","0.1.0":"2026-06-02T14:34:47.803Z","0.2.0":"2026-06-08T10:06:05.366Z","0.4.0":"2026-06-08T10:49:47.710Z","0.5.0":"2026-06-08T11:53:40.775Z","0.5.1":"2026-06-08T13:18:56.089Z","0.6.0":"2026-06-15T15:31:54.276Z","0.7.0":"2026-06-15T16:18:25.250Z"},"bugs":{"url":"https://github.com/Airnauts/commenting-tool/issues"},"author":{"name":"Airnauts"},"license":"MIT","homepage":"https://github.com/Airnauts/commenting-tool#readme","keywords":["comments","commenting","annotations","feedback","airnauts","mongodb","adapter"],"repository":{"url":"git+https://github.com/Airnauts/commenting-tool.git","type":"git","directory":"packages/adapter-mongo"},"description":"MongoDB repository adapter for the Airnauts commenting tool server.","maintainers":[{"name":"jkrzemie","email":"hello@airnauts.com"},{"name":"mateuszpaulski","email":"mateusz@airnauts.com"}],"readme":"# @airnauts/comments-adapter-mongo\n\nMongoDB repository adapter for the [Airnauts commenting tool](https://github.com/Airnauts/commenting-tool) server. Persists threads and attachments to a MongoDB Atlas (or self-hosted) database.\n\n## Installation\n\n```bash\npnpm add @airnauts/comments-adapter-mongo mongodb\n```\n\n## Quick start\n\n```ts\nimport { mongoRepository } from '@airnauts/comments-adapter-mongo'\n\nconst repository = mongoRepository({ uri: process.env.MONGODB_URI! })\n```\n\nPass `repository` to `createCommentsServer` from `@airnauts/comments-server` (or to `createCommentsAppRoute` / `createCommentsPagesRoute` from `@airnauts/comments-next`). The adapter connects lazily on first use.\n\n## API reference\n\n### `mongoRepository(opts)`\n\nThe recommended factory for most setups. Connects lazily on first use and memoizes the connection under a `cacheKey` so hot reloads and warm serverless invocations share the same client.\n\n```ts\nmongoRepository({\n  uri: string       // MongoDB connection string (required)\n  cacheKey?: string // memoization key, default \"mongo\"\n}): Repository\n```\n\n### `createMongoRepository(opts)`\n\nLower-level factory for callers that manage their own `Db` instance:\n\n```ts\nimport { createMongoRepository, ensureIndexes } from '@airnauts/comments-adapter-mongo'\nimport { MongoClient } from 'mongodb'\n\nconst client = new MongoClient(process.env.MONGODB_URI!)\nconst db = client.db()\nawait ensureIndexes(db)\nconst repository = createMongoRepository({ db })\n```\n\n### `ensureIndexes(db)`\n\nCreates the required indexes on the `threads` and `attachments` collections. Safe to call on every startup (`createIndexes` is idempotent). Call once during app boot when using `createMongoRepository`.\n\n> The `mongoRepository` convenience calls `ensureIndexes` automatically the first time it connects.\n\n## Requirements\n\n- Node.js ≥ 18\n- MongoDB ≥ 5.0 (Atlas or self-hosted)\n- `mongodb` ^6.12.0 (peer dependency, installed separately)\n\n## Related packages\n\n- **`@airnauts/comments-server`** — defines the `Repository` interface\n- **`@airnauts/comments-adapter-postgres`** — PostgreSQL alternative\n- **`@airnauts/comments-adapter-memory`** — in-memory adapter for dev/tests\n- **`@airnauts/comments-next`** — Next.js integration that accepts this adapter\n\n## License\n\nMIT © Airnauts\n","readmeFilename":"README.md"}