mongodb type script safe driver
npm install mongodb-typesafe-driverType-safe MongoDB driver for Node.js with improved developer experience using TypeScript.
- Fully type-safe operations for MongoDB collections
- Strongly typed find, insert, update, aggregate, etc.
- Inference for schemas and documents
- Minimal and dependency-free
``bash`
npm install mongodb-typesafe-driver
Requires mongodb v5 as a peer dependency:
`bash``
npm install mongodb
MongoDb not support type safe, see details:
https://www.mongodb.com/docs/drivers/node/current/fundamentals/typescript/#type-safety-and-dot-notation
To improve mongodb types to make queries type safe.
Not use code, only types.
!alt text
!alt text
!alt text
!alt text
!alt text
!alt text
Just use Collection type from this repository instead original Collection mongodb type.
See examples.ts for details.