{"_id":"@ascendance-hub/sapphire-mongoose","_rev":"8-18c29ed03cbb91de362fcaa6bc184d5e","name":"@ascendance-hub/sapphire-mongoose","dist-tags":{"latest":"1.2.0","preview":"0.0.0-preview-20260531194731"},"versions":{"1.0.0":{"name":"@ascendance-hub/sapphire-mongoose","version":"1.0.0","keywords":["typescript","schema","mongoose","mongodb","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-mongoose@1.0.0","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"f2d48b06ff42da0b6fb9c540422132ca94638b5c","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-mongoose/-/sapphire-mongoose-1.0.0.tgz","fileCount":7,"integrity":"sha512-4nrwzTT2xj82U+BrrilhSeE/Fmi5r6ehOl26+SJ/FUxNCv7cnlUxcx+6eYJgYjHjNxuXp39MquxqPuCZaXIhpQ==","signatures":[{"sig":"MEYCIQDlM7hHCXCny+8Zmzyy1oiDXkuGBJEa6IOgz4bqc9KAYAIhALl1X0DhXZxA2BRm374ZGRzrJ87D0u4+yiX4vVC/xCQE","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30862},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"7ca237cf34d7dbf4b6002e6eeb8f1948b5fa1401","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/mongoose"},"_npmVersion":"10.9.7","description":"Mongoose adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongoose":"^9.6.1","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"*"},"peerDependencies":{"mongoose":"^9 || ^10","@ascendance-hub/sapphire-core":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-mongoose_1.0.0_1778967981988_0.8097717074810862","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260518150854":{"name":"@ascendance-hub/sapphire-mongoose","version":"0.0.0-preview-20260518150854","keywords":["typescript","schema","mongoose","mongodb","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-mongoose@0.0.0-preview-20260518150854","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"837aff20f6d97da0445376a3943eba58f20339b8","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-mongoose/-/sapphire-mongoose-0.0.0-preview-20260518150854.tgz","fileCount":7,"integrity":"sha512-Y9wViAg/stqVspRv978Ivbmr6W8ED93rupfSq2nt7QXcblEL/ObAIMH+A13/RVg1bizcJlCkzjvd4k0qlU/jlQ==","signatures":[{"sig":"MEQCIEo5ZP4RaKMkJTnECbzyataNzliSiin80BgKbrzM+PxxAiAS9/KY3Jdu5Nltmdkyi++CROTTynR6ucp+Pj5OoR+6SQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30933},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"7b0ae9d5231c706543b59d36b56e9d7a73697dd8","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/mongoose"},"_npmVersion":"10.9.7","description":"Mongoose adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongoose":"^9.6.1","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518150854"},"peerDependencies":{"mongoose":"^9 || ^10","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518150854"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-mongoose_0.0.0-preview-20260518150854_1779116938368_0.9251460020976074","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260518153515":{"name":"@ascendance-hub/sapphire-mongoose","version":"0.0.0-preview-20260518153515","keywords":["typescript","schema","mongoose","mongodb","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-mongoose@0.0.0-preview-20260518153515","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"31e21a4d0b153aca92e674410aaa6e121411b4d7","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-mongoose/-/sapphire-mongoose-0.0.0-preview-20260518153515.tgz","fileCount":7,"integrity":"sha512-ZlnOPiQ7wBsA3q7B0iGXIjUPHh3O4KtTEVWdUYtVL1B6xVcMQyD11p5owjob2TD1QGJt8d43t8/7ahTjiHnG6g==","signatures":[{"sig":"MEUCIQDDiurf5IXzBHbARle24u/gOGYE1Qezj73LTrNKXe585QIgHnXGN3Fx37uiqkbJBPIrzNhmW3p/eDp0XZdGuZtWIig=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30933},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"7f07a1e46fe73ca49f03f7b373377b184481c0b2","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/mongoose"},"_npmVersion":"10.9.7","description":"Mongoose adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongoose":"^9.6.1","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518153515"},"peerDependencies":{"mongoose":"^9 || ^10","@ascendance-hub/sapphire-core":"0.0.0-preview-20260518153515"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-mongoose_0.0.0-preview-20260518153515_1779118519269_0.912931835545405","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@ascendance-hub/sapphire-mongoose","version":"1.1.0","keywords":["typescript","schema","mongoose","mongodb","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-mongoose@1.1.0","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"f2f6cc35bed1990a356b3b45816aa39f9c27596b","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-mongoose/-/sapphire-mongoose-1.1.0.tgz","fileCount":7,"integrity":"sha512-bylch3n7+Nuuy2uevm9zB1rxrM+SOUrfWdFxH6MGx7cDL1lSM90ZP098hT3s5NwN71fcmRzBJZuYRQr95LFPxQ==","signatures":[{"sig":"MEQCIBdhWKiCfXA8eUKHLuIqLcqc+5Kyf8NWfFMthcRFxJsJAiBVvXU77A3z0C4qvMQe9vp2YYRWQASwHX+DvdKcXv/6oQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30862},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"76178e21015fe89d02d149a06998178a2d956a3f","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/mongoose"},"_npmVersion":"10.9.7","description":"Mongoose adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.2","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"mongoose":"^9.6.1","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"*"},"peerDependencies":{"mongoose":"^9 || ^10","@ascendance-hub/sapphire-core":">=1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-mongoose_1.1.0_1779118573692_0.25334341833034246","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260531184331":{"name":"@ascendance-hub/sapphire-mongoose","version":"0.0.0-preview-20260531184331","keywords":["typescript","schema","mongoose","mongodb","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-mongoose@0.0.0-preview-20260531184331","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"ea21e97729e61c0b2a07ea28c73cd88e7eb2aa3f","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-mongoose/-/sapphire-mongoose-0.0.0-preview-20260531184331.tgz","fileCount":7,"integrity":"sha512-YIpMom0CE6qEHBg+HNuLna83cPuXwo02uvayj8b8V5y7jxwKiiIB4G9g8FJ8g0HYxtzG1JPVcEG7TTiwwiMzmg==","signatures":[{"sig":"MEUCIEK1UrHUYjjwkVGFYsm+vIvPhr69476RafIP2TXbVO7nAiEAtRJYyGFgMKPkdIG5eYfKImdD7Ctht/g1v4+CZEgZmng=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30933},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"e8461b27236d5fc3b9b0810c610bc53c79e7e5fc","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/mongoose"},"_npmVersion":"10.9.8","description":"Mongoose adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongoose":"^9.6.1","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531184331"},"peerDependencies":{"mongoose":"^9 || ^10","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531184331"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-mongoose_0.0.0-preview-20260531184331_1780253015041_0.06976373150233339","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260531190529":{"name":"@ascendance-hub/sapphire-mongoose","version":"0.0.0-preview-20260531190529","keywords":["typescript","schema","mongoose","mongodb","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-mongoose@0.0.0-preview-20260531190529","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"df48b832d0ba0c2531e20e86529ff0fdfdd9b84a","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-mongoose/-/sapphire-mongoose-0.0.0-preview-20260531190529.tgz","fileCount":7,"integrity":"sha512-WDe+vXJZW3QMlCdjUZBlvD9jEnhpvNKBeepckP8m/sLxdWP+XADOdfVv1t8tcW+mzmDNtbPg69dgiaw3Od+Npw==","signatures":[{"sig":"MEUCIFc7hAy/i9bjQQ2nzBw1g+BMD2XM1GL+2odVSNZz4Fe9AiEAkeV/gFurZFAmKkw5aoGUYSc7dm2QpNEQts8NMHYvipQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30933},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"8a9b61513b5f64c6449a6a061d9bb6e0ffe7c865","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/mongoose"},"_npmVersion":"10.9.8","description":"Mongoose adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongoose":"^9.6.1","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531190529"},"peerDependencies":{"mongoose":"^9 || ^10","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531190529"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-mongoose_0.0.0-preview-20260531190529_1780254332817_0.26114224393568075","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-preview-20260531194731":{"name":"@ascendance-hub/sapphire-mongoose","version":"0.0.0-preview-20260531194731","keywords":["typescript","schema","mongoose","mongodb","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","_id":"@ascendance-hub/sapphire-mongoose@0.0.0-preview-20260531194731","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"dist":{"shasum":"5d98d1c8b4f4895853bc0a392de130303a1f5371","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-mongoose/-/sapphire-mongoose-0.0.0-preview-20260531194731.tgz","fileCount":7,"integrity":"sha512-iv5xCazCC8zy/78dWf5Mg5tdnV2X6qNdQ4bLZjPPHBmaT3Wo9VyA2/UT2iSTWmarqemtw8EOkjFs1bIq0LsQdQ==","signatures":[{"sig":"MEUCIBB62IH6cGJ7L5LvQvVCwo/lby+8uq9J5zdfdusPJ7CyAiEA3629Jm1UpZgnX96kd8Gh5oSVsHyL0SH0DZ2kuWoaaXo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30933},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20"},"exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"gitHead":"dd7c2b94ce17eb7f2754a707b058e45e23baa1f9","scripts":{"test":"vitest run","build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"repository":{"url":"git+https://github.com/Ascendance-Hub/Sapphire.git","type":"git","directory":"packages/mongoose"},"_npmVersion":"10.9.8","description":"Mongoose adapter for Sapphire.","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"mongoose":"^9.6.1","mongodb-memory-server":"^11.0.0","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531194731"},"peerDependencies":{"mongoose":"^9 || ^10","@ascendance-hub/sapphire-core":"0.0.0-preview-20260531194731"},"_npmOperationalInternal":{"tmp":"tmp/sapphire-mongoose_0.0.0-preview-20260531194731_1780256854214_0.6143343088017086","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@ascendance-hub/sapphire-mongoose","version":"1.2.0","description":"Mongoose adapter for Sapphire.","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"require":{"types":"./dist/index.d.cts","default":"./dist/index.cjs"}},"./package.json":"./package.json"},"sideEffects":false,"scripts":{"build":"tsup","test":"vitest run","typecheck":"tsc --noEmit"},"peerDependencies":{"@ascendance-hub/sapphire-core":">=1.0.0","mongoose":"^9 || ^10"},"devDependencies":{"@ascendance-hub/sapphire-core":"*","mongodb-memory-server":"^11.0.0","mongoose":"^9.6.1"},"repository":{"type":"git","url":"git+https://github.com/Ascendance-Hub/Sapphire.git","directory":"packages/mongoose"},"keywords":["typescript","schema","mongoose","mongodb","sapphire"],"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","publishConfig":{"access":"public"},"engines":{"node":">=20"},"bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","_id":"@ascendance-hub/sapphire-mongoose@1.2.0","gitHead":"c385975185892d170d5f003f45740273bfb29d15","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-Epgb87n8vH7Nm11xgr85Kai2m3LwdaCqvEpJ86/NACFV/MqZRdDayYrOZ7C6NA+BIjhuF3aYkOTZDsVFLhLkww==","shasum":"8e530063513856a24ba8d687149e3675e9319965","tarball":"https://registry.npmjs.org/@ascendance-hub/sapphire-mongoose/-/sapphire-mongoose-1.2.0.tgz","fileCount":7,"unpackedSize":30862,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDJLOnxD7dGsHRJqXJIx/5mjQOZfxU6hxvECeJyaEKOygIhAP184KpHRwL3oO3C6Li5Za7ZqBPybU6oTA9GveqPYTyq"}]},"_npmUser":{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"},"directories":{},"maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sapphire-mongoose_1.2.0_1780257338454_0.6003435073128589"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-16T21:46:21.848Z","modified":"2026-05-31T19:55:38.735Z","1.0.0":"2026-05-16T21:46:22.136Z","0.0.0-preview-20260518150854":"2026-05-18T15:08:58.577Z","0.0.0-preview-20260518153515":"2026-05-18T15:35:19.443Z","1.1.0":"2026-05-18T15:36:13.831Z","0.0.0-preview-20260531184331":"2026-05-31T18:43:35.198Z","0.0.0-preview-20260531190529":"2026-05-31T19:05:32.948Z","0.0.0-preview-20260531194731":"2026-05-31T19:47:34.352Z","1.2.0":"2026-05-31T19:55:38.589Z"},"bugs":{"url":"https://github.com/Ascendance-Hub/Sapphire/issues"},"author":{"name":"Alexandre Damas Murata","email":"alexandre_murata@hotmail.com"},"license":"MIT","homepage":"https://github.com/Ascendance-Hub/Sapphire#readme","keywords":["typescript","schema","mongoose","mongodb","sapphire"],"repository":{"type":"git","url":"git+https://github.com/Ascendance-Hub/Sapphire.git","directory":"packages/mongoose"},"description":"Mongoose adapter for Sapphire.","maintainers":[{"name":"alexandre-murata","email":"alexandre_murata@hotmail.com"}],"readme":"# @ascendance-hub/sapphire-mongoose\n\nMongoose adapter for [Sapphire](https://github.com/Ascendance-Hub/Sapphire). Converts a Sapphire IR (`SapphireSchemaNode`) into a `mongoose.Schema` (top-level) or a `SchemaTypeDefinition` (nested).\n\n> **Unofficial.** A community adapter — not affiliated with, sponsored, or endorsed by the Mongoose project or Automattic, Inc.\n\n> Using the native MongoDB driver instead of Mongoose? See [`@ascendance-hub/sapphire-bson`](https://www.npmjs.com/package/@ascendance-hub/sapphire-bson), which emits `$jsonSchema` collection validators.\n\n## Install\n\n```bash\nnpm install @ascendance-hub/sapphire-core @ascendance-hub/sapphire-mongoose mongoose\n```\n\n`@ascendance-hub/sapphire-core` and `mongoose` are peer dependencies — they must be installed alongside this package.\n\n## Register the adapter\n\nThe adapter is **not auto-registered**. Call `registerAdapter` once in your application entry point:\n\n```ts\nimport { Sapphire, registerAdapter } from '@ascendance-hub/sapphire-core'\nimport { toMongooseSchema } from '@ascendance-hub/sapphire-mongoose'\n\nregisterAdapter('mongoose', toMongooseSchema)\n\nexport const a = new Sapphire({ defaultAdapter: 'mongoose' })\n```\n\n## Quickstart\n\n```ts\nimport mongoose from 'mongoose'\nimport { toMongooseSchema } from '@ascendance-hub/sapphire-mongoose'\nimport { a } from './sapphire'\n\nconst User = a\n  .object({\n    name: a.string().min(1),\n    email: a.string().email().unique(),\n    age: a.number().int().min(0).optional(),\n  })\n  .name('User')\n  .timestamps()\n  .index(['email'], { unique: true })\n\nconst UserSchema = toMongooseSchema(User.toSchema()) as mongoose.Schema\nconst UserModel = mongoose.model('User', UserSchema)\n```\n\n## IR mapping table\n\n| IR `kind` | Mongoose output                                      | Notes                                                                                        |\n| --------- | ---------------------------------------------------- | -------------------------------------------------------------------------------------------- |\n| `string`  | `{ type: String, ... }`                              | `format` (email/url/uuid), `startsWith`/`endsWith` via custom validators.                    |\n| `number`  | `{ type: Number, ... }`                              | `exclusiveMin`/`Max`/`int`/`multipleOf`/`finite`/`safe` via `validate: [...]`.               |\n| `boolean` | `{ type: Boolean, ... }`                             | —                                                                                            |\n| `date`    | `{ type: Date, min, max }`                           | —                                                                                            |\n| `object`  | `mongoose.Schema` (top-level) or sub-Schema (nested) | Subdocs default to `_id: false`. Override with `toMongooseSchema(node, { subdocId: true })`. |\n| `array`   | `{ type: [item], ... }`                              | Homogeneous; item is recursively converted.                                                  |\n| `tuple`   | `{ type: [Mixed], validate: length }`                | Per-position type-checking lives in core (`safeParse`); Mongoose only checks length.         |\n| `union`   | `{ type: Mixed }`                                    | Validation lives in core. No Mongoose-level checks.                                          |\n| `literal` | `{ type: <ctor>, enum: [value] }`                    | Constructor inferred from literal type.                                                      |\n| `enum`    | `{ type: <ctor>, enum: [...values] }`                | Constructor String for string-enum, Number for number-enum.                                  |\n| `record`  | `{ type: Map, of: <values> }` or `Mixed`             | `Map` when keyField is string/enum/literal; `Mixed` fallback otherwise.                      |\n| `ref`     | `{ type: ObjectId, ref: <name> }`                    | `ref` resolves to the named schema's `name(...)`.                                            |\n\n### Schema-level\n\n- `ObjectField.timestamps()` → `new Schema(def, { timestamps: true })`.\n- `ObjectField.index(keys, opts?)` → `schema.index({ ...keys: 1 }, opts)` per call (multiple calls accumulate).\n- `ObjectField.adapter('mongoose', { collection: 'people' })` → `new Schema(def, { collection: 'people' })`.\n\n## `.adapter('mongoose', opts)` escape hatch\n\nAny options passed via `.adapter('mongoose', { ... })` are merged into the Mongoose `SchemaTypeOptions` for that field (last-wins). Common keys:\n\n| Key           | Effect                                                              |\n| ------------- | ------------------------------------------------------------------- |\n| `sparse`      | Mongoose-native `sparse: true` (sparse index).                      |\n| `collation`   | Mongoose-native `collation`.                                        |\n| `description` | Preserved on `SchemaType.options.description` (introspection only). |\n| `collection`  | (top-level only) Sets `Schema.options.collection`.                  |\n\n**Blacklist:** `type` and `required` cannot be overridden via `.adapter('mongoose', ...)`. They are always Sapphire-controlled.\n\n## `MongooseAdapterOptions`\n\n| Option     | Default  | Effect                                                                                       |\n| ---------- | -------- | -------------------------------------------------------------------------------------------- |\n| `subdocId` | `false`  | Whether nested object Schemas auto-add `_id`. Default deviates from Mongoose's `true`.       |\n| `rootId`   | `'auto'` | Root document `_id` strategy. `'auto'` = Mongoose default; `'none'` = emit `{ _id: false }`. |\n\n```ts\ntoMongooseSchema(node, { subdocId: true })\n```\n\n### Custom root `_id`\n\nDeclare a field literally named `_id` to use a custom identity instead of the\nauto-generated `ObjectId` — Mongoose honors a declared `_id` path:\n\n```ts\nconst User = a.object({ _id: a.string(), name: a.string() })\ntoMongooseSchema(User.toSchema()) // String _id, no auto ObjectId\n```\n\n`rootId: 'none'` strips the root `_id` entirely (ignored when the schema\ndeclares its own `_id`).\n\n## Limitations\n\n- **Tuple per-position type-checking** is not enforced at the Mongoose level. Mongoose validators only check the array length. For full tuple validation (per-position type), use `safeParse` from core.\n- **Union** is materialized as `Mixed` with no Mongoose-level validation. Use core's `safeParse` for the canonical check.\n- **`nullable`** has no dedicated Mongoose flag. A non-required field accepts `null` implicitly. Sapphire IR `nullable: true` is a no-op in this adapter.\n- **`coerce`** is ignored — Mongoose has its own cast layer that handles coercion universally; opt out via core (`safeParse`) before persisting if needed.\n- **Subdoc `_id: false`** is the default. Set `subdocId: true` to opt back in to Mongoose's default.\n- **Auto-register removed.** Call `registerAdapter('mongoose', toMongooseSchema)` once in your entry point.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}