interface extending mongoose document object does not contain _doc object typescript

The solution for “interface extending mongoose document object does not contain _doc object typescript” can be found here. The following code will assist you in solving the problem.

// create a generic interface
import { Document } from ‘mongoose’;

export interface DocumentResult extends Document {
_doc: T;
}

interface IUser extends DocumentResult {
id: string;
firstname: string;
lastname: string;
phoneNumber: IPhoneNumber;
email: string;
password: string;
}

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

0
inline scripts encapsulated in