Skip to content

StagnantIce/mongodb-typesafe-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongodb-typesafe-driver

Type-safe MongoDB driver for Node.js with improved developer experience using TypeScript.

✨ Features

  • Fully type-safe operations for MongoDB collections
  • Strongly typed find, insert, update, aggregate, etc.
  • Inference for schemas and documents
  • Minimal and dependency-free

📦 Installation

npm install mongodb-typesafe-driver

Requires mongodb v5 as a peer dependency:

npm install mongodb

Why ?

MongoDb not support type safe, see details:

https://www.mongodb.com/docs/drivers/node/current/fundamentals/typescript/#type-safety-and-dot-notation

Goal

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

Support nested? Yes!

alt text
alt text

How it use?

Just use Collection type from this repository instead original Collection mongodb type.

See examples.ts for details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors