MongoDB adapter for Lucid ORM (AdonisJS 6), version 2.1.0. Actively developed with over 100 tests, enabling MongoDB integration using the familiar Lucid ORM API with full TypeScript support. Supports Active Record pattern, decorators, relationships (HasOne, HasMany, BelongsTo), and direct MongoDB access. Requires @adonisjs/core ^6.0.0. Not yet production-ready; roadmap includes pagination, migrations, factories and seeds. Peer dependencies: @adonisjs/core. Node >=16.
npm install mongo-adonisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Defines a User model using MongoModel decorators and performs basic CRUD operations (create, read, update, delete).
Pin exact version or test upgrades thoroughly.
import { ObjectId } from 'mongo-adonis'import { hasMany, belongsTo } from 'mongo-adonis'Run: bun install mongo-adonis
Ensure class extends MongoModel: export class User extends MongoModel { ... }Add "type": "module" in package.json or use .mjs extension.