
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
@nestjsbase/mongoose
Advanced tools
This is a library includes inheritable classes that can help you to save your time when create CRUD module in NestJS. This classes are supporting for mongoose. If you want to use typeorm instead, you can go [here](https://www.npmjs.com/package/@nestjsbase
This is a library includes inheritable classes that can help you to save your time when create CRUD module in NestJS. This classes are supporting for mongoose. If you want to use typeorm instead, you can go here
npm install @nestjsbase/mongoose
First, you have create your own entity class and inherit BaseModel of @nestjsbase/mongoose
import { Schema, Prop } from '@nestjs/mongoose';
import { BaseModel } from '@nestjsbase/mongoose';
@Schema({ timestamp: true })
export class UserModel extends BaseModel {
@Prop()
name!: string;
}
You have to enable timestamp if you want to use createdAt and updatedAt
This is BaseModel actually do in background
export class BaseModel {
@Prop({ type: Date })
createdAt!: Date;
@Prop({ type: Date })
updatedAt!: Date;
@Prop({ type: Date })
deletedAt!: Date;
}
Now, make your service inherit BaseService
import { Model } from 'mongoose';
import { BaseService } from '@nestjsbase/mongoose';
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { UserModel } from '../user.model';
@Injectable()
export class UserService extends BaseService {
constructor(@InjectModel(UserModel.name) private userModel: Model<UserModel>){
super(userModel);
}
}
This BaseService already have methods:
export class IBaseService {
create(...);
createMany(...);
getOne(...);
getOneOrFail(...);
getOneById(...);
getOneByIdOrFail(...);
getAll(...);
getAllWithPagination(...);
update(...);
updateById(...);
remove(...);
removeById(...);
softRemove(...);
softRemoveById(...);
}
export interface IPagination<T> {
data: T[];
pagination: {
limit: number;
page: number;
total: number;
};
}
FAQs
This is a library includes inheritable classes that can help you to save your time when create CRUD module in NestJS. This classes are supporting for mongoose. If you want to use typeorm instead, you can go [here](https://www.npmjs.com/package/@nestjsbase
The npm package @nestjsbase/mongoose receives a total of 2 weekly downloads. As such, @nestjsbase/mongoose popularity was classified as not popular.
We found that @nestjsbase/mongoose demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.