Documentation Index
Fetch the complete documentation index at: https://www.esixorm.com/llms.txt
Use this file to discover all available pages before exploring further.
Getting Started with Esix
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:Note: You’ll need bothesixandmongodbpackages to get started.
Creating Your First Model
Let’s start by defining your first model. Here’s how you can create a simpleBook model:
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:- Configuration - Learn how to configure your database connection
- Defining Models - Discover advanced model features and relationships
- Retrieving Models - Master complex queries and aggregations