UNPKG

@sentzunhat/zacatl

Version:

A modular, high-performance TypeScript microservice framework for Node.js, featuring layered architecture, dependency injection, and robust validation for building scalable APIs and distributed systems.

32 lines 846 B
import { createMongooseAdapter } from '../../orm/mongoose/adapter-loader.js'; export class AbstractMongooseRepository { adapter; constructor(config) { this.adapter = createMongooseAdapter(config); } get model() { return this.adapter.model; } toLean(input) { return this.adapter.toLean(input); } async findById(id) { return this.adapter.findById(id); } async findMany(filter = {}) { return this.adapter.findMany(filter); } async create(entity) { return this.adapter.create(entity); } async update(id, update) { return this.adapter.update(id, update); } async delete(id) { return this.adapter.delete(id); } async exists(id) { return this.adapter.exists(id); } } //# sourceMappingURL=repository.js.map