Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

interface extending mongoose document object does not contain _doc object typescript

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

export interface DocumentResult<T> extends Document {
    _doc: T;
}

interface IUser extends DocumentResult<IUser> {
    id: string;
    firstname: string;
    lastname: string;
    phoneNumber: IPhoneNumber;
    email: string;
    password: string;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #interface #extending #mongoose #document #object #object #typescript
ADD COMMENT
Topic
Name
4+4 =