MongORM Documentation
Published under Azayn Labs — Home: www.azayn.com
Azayn Labs is currently an operating open-source brand and not yet a registered legal entity.
Note: The homepage currently shows a coming-soon page.
MongORM is a production-ready, type-safe MongoDB ORM for Go focused on high developer velocity, clean data access patterns, and MongoDB-native flexibility.
This documentation covers everything from first setup to advanced patterns for Go + MongoDB applications: type-safe query building, CRUD operations, aggregation pipelines, transactions, hooks, indexes, and performance-friendly cursor workflows.
Best For
- Go backend services using MongoDB as a primary datastore
- Teams that want typed query builders with minimal runtime surprises
- API and platform projects that need fast iteration plus production safety
- Developers who want an ORM-like DX without losing direct MongoDB control
Getting Started
- Getting Started — Installation, model definition, schema setup, and first steps
- Configuration — Struct tag configuration, options struct, and mixed mode
CRUD Operations
- Creating Documents — Inserting new documents with
Save()
- Finding Documents — Querying with
First() / Find(), typed projection decoding, count, and distinct
- Updating Documents — Updating single or multiple documents
- Deleting Documents — Removing documents from a collection
- Bulk Write — Executing batch insert/update/replace/delete operations
- Indexes — Field-based index builders and geo index setup
- Aggregation — MongoDB aggregation pipelines with fluent stages and typed decoding
- Cursors — Iterating over multiple results with
FindAll()
Query Building
- Query Building — Type-safe filters, pagination helpers, projection, and update operators
- Primitives — Type-safe field types (including geospatial) and their query methods
Advanced
- Hooks — Lifecycle hooks for all CRUD operations
- Transactions — Execute operations in an atomic multi-step transaction
- Errors — Sentinel error taxonomy for consistent application handling
- Timestamps — Automatic
CreatedAt / UpdatedAt management
- Utility Types — Pointer helpers:
String(), Bool(), Int64(), Timestamp()
Discoverability Keywords
Go MongoDB ORM, type-safe query builder, Golang MongoDB library, MongoDB CRUD in Go, MongoDB aggregation Go, MongoDB transactions Go, MongoDB bulk operations Go, Go backend data layer.
README