import { InjectModel } from "@nestjs/mongoose"; import { Model, Types } from "mongoose"; import { UserSignModel } from "../schema/sign.schema"; export class UserSignDbService { constructor( @InjectModel(UserSignModel.name) private readonly blameVoiceModel: Model, ) {} async create(sign: UserSignModel): Promise { return await this.blameVoiceModel.create(sign); } async findOne(id: string): Promise { return await this.blameVoiceModel.findOne(new Types.ObjectId(id)); } async findById(id: string): Promise { // Use your correct Model type return this.blameVoiceModel.findById(id).lean(); } }