Skip to main content
Esix is a slick ORM for MongoDB that makes working with your database in TypeScript a breeze! 🥧 Inspired by ActiveRecord and Eloquent, Esix uses a Convention over Configuration approach. This means you can define your models as normal TypeScript classes with minimal boilerplate.

Installation

Getting Esix up and running is simple! Just add the package using your favorite package manager: Using Yarn:
Using NPM:
Note: You’ll need both esix and mongodb packages to get started.

Creating Your First Model

Let’s start by defining your first model. Here’s how you can create a simple Book model:
That’s it! The BaseModel automatically provides id and timestamp fields (createdAt and updatedAt), so you don’t have to worry about those.

Creating Records

Now you’re ready to create some data! Here’s how you can add books to your database:

Querying Your Data

Once you have some data, querying is just as simple! Here’s how you can retrieve books:

What’s Next?

Congratulations! You’ve just created your first Esix model and learned the basics of creating and querying data. Here are some next steps to explore: Using Effect 3? Follow the Effect Quickstart for a complete setup.