Interface CustomModel<TRawDocType, TQueryHelpers, TInstanceMethods, TVirtuals, THydratedDocumentType, TSchema> interface CustomModel < TRawDocType = unknown , TQueryHelpers = unknown , TInstanceMethods = unknown , TVirtuals = unknown , THydratedDocumentType = HydratedDocument < TRawDocType , TVirtuals & TInstanceMethods , TQueryHelpers , > , TSchema = any , > { new CustomModel < DocType = Partial < TRawDocType > > ( doc ?: DocType , fields ?: any , options ?: AnyObject , ) : THydratedDocumentType ; base : __module ; baseModelName : string | undefined ; collection : Collection ; db : Connection ; discriminators : | { [ name : string ]: Model < any , {} , {} , {} , any , any , any > } | undefined ; events : EventEmitter ; modelName : string ; schema : TSchema ; "[captureRejectionSymbol]" ? ( error : Error , event : string | symbol , ... args : any [] , ) : void ; $where ( argument : string | Function , ) : QueryWithHelpers < THydratedDocumentType [] , THydratedDocumentType , TQueryHelpers , TRawDocType , "find" , TInstanceMethods & TVirtuals , > ; addListener < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this ; aggregate < R = any > ( pipeline ?: PipelineStage [] , options ?: AggregateOptions , ) : Aggregate < R [] > ; aggregate < R = any > ( pipeline : PipelineStage [] ) : Aggregate < R [] > ; aggregation < ResultElementType > () : Aggregation < ResultElementType > ; applyDefaults ( obj : AnyObject ) : AnyObject ; applyDefaults ( obj : TRawDocType ) : TRawDocType ; applyTimestamps ( obj : AnyObject , options ?: { currentTime ?: () => Date ; isUpdate ?: boolean } , ) : AnyObject ; applyVirtuals ( obj : AnyObject , virtalsToApply ?: string [] ) : AnyObject ; bulkSave ( documents : Document < ObjectId , any , any , Record < string , any > , {} > [] , options ?: MongooseBulkSaveOptions , ) : Promise < MongooseBulkWriteResult > ; bulkWrite < DocContents = TRawDocType > ( writes : AnyBulkWriteOperation < DocContents extends Document ? DocContents < DocContents > : any , > [] , options : BulkWriteOptions & MongooseBulkWriteOptions & { ordered : false } , ) : Promise < BulkWriteResult & { mongoose ?: { validationErrors : Error [] } } > ; bulkWrite < DocContents = TRawDocType > ( writes : AnyBulkWriteOperation < DocContents extends Document ? DocContents < DocContents > : any , > [] , options ?: BulkWriteOptions & MongooseBulkWriteOptions , ) : Promise < BulkWriteResult > ; castObject ( obj : AnyObject , options ?: { ignoreCastErrors ?: boolean } , ) : TRawDocType ; cleanIndexes ( options ?: { hideIndexes ?: boolean ; toDrop ?: string [] } , ) : Promise < string [] > ; clientEncryption () : ClientEncryption | null ; countDocuments ( filter ?: QueryFilter < TRawDocType > , options ?: | CountOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } & Abortable | null , ) : QueryWithHelpers < number , THydratedDocumentType , TQueryHelpers , TRawDocType , "countDocuments" , TInstanceMethods & TVirtuals , > ; countDocuments ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , options ?: | CountOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } & Abortable | null , ) : QueryWithHelpers < number , THydratedDocumentType , TQueryHelpers , TRawDocType , "countDocuments" , TInstanceMethods & TVirtuals , > ; create () : Promise < null > ; create ( doc : Partial < TRawDocType > ) : Promise < THydratedDocumentType > ; create ( docs : Partial < TRawDocType > [] ) : Promise < THydratedDocumentType [] > ; create ( docs : DeepPartial < ApplyBasicCreateCasting < Require_id < TRawDocType > > > [] , options : CreateOptions & { aggregateErrors : true } , ) : Promise < (
THydratedDocumentType | Error )
[] > ; create ( docs : DeepPartial < ApplyBasicCreateCasting < Require_id < TRawDocType > > > [] , options ?: CreateOptions , ) : Promise < THydratedDocumentType [] > ; create ( doc : DeepPartial < ApplyBasicCreateCasting < Require_id < TRawDocType > > > , ) : Promise < THydratedDocumentType > ; create ( ... docs : DeepPartial < ApplyBasicCreateCasting < Require_id < TRawDocType > > > [] , ) : Promise < THydratedDocumentType [] > ; createCollection < T extends Document > ( options ?: CreateCollectionOptions & Pick < SchemaOptions < unknown , {} , {} , {} , {} , Document < unknown , {} , unknown , {} , DefaultSchemaOptions > & { _id : ObjectId ; } & { __v : number } & { id : string } , Model < unknown , {} , {} , {} , Document < unknown , {} , unknown , {} , DefaultSchemaOptions > & { _id : ObjectId ; } & { __v : number } & { id : string } , any , unknown , > , > , "expires" , > , ) : Promise < Collection < T > > ; createIndexes ( options ?: CreateIndexesOptions ) : Promise < void > ; createSearchIndex ( description : SearchIndexDescription ) : Promise < string > ; createSearchIndexes () : Promise < string [] > ; deleteMany ( filter ?: QueryFilter < TRawDocType > , options ?: | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null , ) : QueryWithHelpers < DeleteResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "deleteMany" , TInstanceMethods & TVirtuals , > ; deleteMany ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , options ?: | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null , ) : QueryWithHelpers < DeleteResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "deleteMany" , TInstanceMethods & TVirtuals , > ; deleteOne ( filter ?: QueryFilter < TRawDocType > , options ?: | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null , ) : QueryWithHelpers < DeleteResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "deleteOne" , TInstanceMethods & TVirtuals , > ; deleteOne ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , options ?: | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null , ) : QueryWithHelpers < DeleteResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "deleteOne" , TInstanceMethods & TVirtuals , > ; diffIndexes ( options ?: Record < string , unknown > ) : Promise < IndexesDiff > ; discriminator < TDiscriminatorSchema extends Schema < any , any , {} , {} , {} , {} , DefaultSchemaOptions , { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } , Document < unknown , {} , { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } , { id : string } , ResolveSchemaOptions < DefaultSchemaOptions > , > & Omit < { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } & Required < { _id : unknown } > & { __v : number } , "id" , > & { id : string } , | { [ path : string ]: SchemaDefinitionProperty < undefined , any , any > } | { [ key : string ]: | SchemaDefinitionProperty < any , any , Document < unknown , {} , { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } , { id : string } , ResolveSchemaOptions < DefaultSchemaOptions > , > & Omit < { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } & Required < { _id : unknown } > & { __v : number } , "id" , > & { id : string } , > | undefined ; } , { [ key : number ]: {} ; [ key : symbol ]: {} ; [ key : string ]: {} } & Required < { _id : unknown } , > & { __v : number } , > , > ( name : string | number , schema : TDiscriminatorSchema , value ?: string | number | ObjectId | DiscriminatorOptions , ) : Model < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , TQueryHelpers & ObtainSchemaGeneric < TDiscriminatorSchema , "TQueryHelpers" > , TInstanceMethods & ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" , > , TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > , IfAny < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , any , (
TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > & TInstanceMethods & ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" , > )
extends Record < string , never > ? Document < unknown , TQueryHelpers & ObtainSchemaGeneric < TDiscriminatorSchema , "TQueryHelpers" , > , TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > , DefaultSchemaOptions , > & Require_id < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , > & { __v : number } & AddDefaultId < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , {} , DefaultSchemaOptions , > : IfAny < TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > & TInstanceMethods & ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" , > , Document < unknown , TQueryHelpers & ObtainSchemaGeneric < TDiscriminatorSchema , "TQueryHelpers" , > , TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > , DefaultSchemaOptions , > & Require_id < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , > & { __v : number } , Document < unknown , TQueryHelpers & ObtainSchemaGeneric < TDiscriminatorSchema , "TQueryHelpers" , > , TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > , DefaultSchemaOptions , > & Omit < Require_id < TRawDocType & IfAny < (...)
, (...)
, (...)
> > & { __v : number ; } , | keyof TVirtuals | keyof ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > | keyof TInstanceMethods | keyof ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" > , > & TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > & TInstanceMethods & ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" , > , > , > , any , TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , > & ObtainSchemaGeneric < TSchema , "TStaticMethods" > & ObtainSchemaGeneric < TDiscriminatorSchema , "TStaticMethods" , > ; discriminator < D > ( name : string | number , schema : Schema , value ?: string | number | ObjectId | DiscriminatorOptions , ) : Model < D > ; discriminator < T , U > ( name : string | number , schema : Schema < T , U > , value ?: string | number | ObjectId | DiscriminatorOptions , ) : U ; distinct < DocKey extends string > ( field : DocKey , filter ?: QueryFilter < TRawDocType > , options ?: QueryOptions < TRawDocType > , ) : QueryWithHelpers < (
DocKey extends keyof WithLevel1NestedPaths < TRawDocType , keyof TRawDocType , > ? WithoutUndefined < Unpacked < WithLevel1NestedPaths < TRawDocType , keyof TRawDocType > [ DocKey < DocKey , > ] , > , > : unknown )
[] , THydratedDocumentType , TQueryHelpers , TRawDocType , "distinct" , TInstanceMethods & TVirtuals , > ; distinct < DocKey extends string > ( field : DocKey , filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , options ?: QueryOptions < TRawDocType > , ) : QueryWithHelpers < (
DocKey extends keyof WithLevel1NestedPaths < TRawDocType , keyof TRawDocType , > ? WithoutUndefined < Unpacked < WithLevel1NestedPaths < TRawDocType , keyof TRawDocType > [ DocKey < DocKey , > ] , > , > : unknown )
[] , THydratedDocumentType , TQueryHelpers , TRawDocType , "distinct" , TInstanceMethods & TVirtuals , > ; dropSearchIndex ( name : string ) : Promise < void > ; emit < E extends string | symbol > ( eventName : string | symbol , ... args : any [] , ) : boolean ; ensureIndexes ( options ?: CreateIndexesOptions ) : Promise < void > ; estimatedDocumentCount ( options ?: QueryOptions < TRawDocType > , ) : QueryWithHelpers < number , THydratedDocumentType , TQueryHelpers , TRawDocType , "estimatedDocumentCount" , TInstanceMethods & TVirtuals , > ; eventNames () : (
string | symbol )
[] ; exists ( filter : QueryFilter < TRawDocType > , ) : QueryWithHelpers < { _id : InferIdType < TRawDocType > } | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > ; exists ( filter : Query < any , any > , ) : QueryWithHelpers < { _id : InferIdType < TRawDocType > } | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > ; find < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , projection : ProjectionType < TRawDocType > | null | undefined , options : QueryOptions < TRawDocType > & { lean : true } & Abortable , ) : QueryWithHelpers < (
Require_id < TRawDocType > extends { __v ?: U } ? { __v ?: U } & Require_id < TRawDocType > : Require_id < TRawDocType > & { __v : number } )
[] , ResultDoc , TQueryHelpers , TRawDocType , "find" , TInstanceMethods & TVirtuals , > ; find ( filter : Query < any , any > , projection : ProjectionType < TRawDocType > | null | undefined , options : QueryOptions < TRawDocType > & { lean : true } & Abortable , ) : QueryWithHelpers < (
Require_id < TRawDocType > extends { __v ?: U } ? { __v ?: U } & Require_id < TRawDocType > : Require_id < TRawDocType > & { __v : number } )
[] , THydratedDocumentType , TQueryHelpers , TRawDocType , "find" , TInstanceMethods & TVirtuals , > ; find < ResultDoc = THydratedDocumentType > ( filter ?: QueryFilter < TRawDocType > , projection ?: ProjectionType < TRawDocType > | null , options ?: QueryOptions < TRawDocType > & Abortable , ) : QueryWithHelpers < ResultDoc [] , ResultDoc , TQueryHelpers , TRawDocType , "find" , TInstanceMethods & TVirtuals , > ; find ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , projection ?: ProjectionType < TRawDocType > | null , options ?: QueryOptions < TRawDocType > & Abortable , ) : QueryWithHelpers < THydratedDocumentType [] , THydratedDocumentType , TQueryHelpers , TRawDocType , "find" , TInstanceMethods & TVirtuals , > ; findById < ResultDoc = THydratedDocumentType > ( id : any , projection : ProjectionType < TRawDocType > | null | undefined , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < TRawDocType | null , ResultDoc , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > ; findById < ResultDoc = THydratedDocumentType > ( id ?: any , projection ?: ProjectionType < TRawDocType > | null , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > ; findByIdAndDelete < ResultDoc = THydratedDocumentType > ( id : any , options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true ; } , ) : QueryWithHelpers < ModifyResult < TRawDocType > , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findByIdAndDelete < ResultDoc = THydratedDocumentType > ( id : any , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < TRawDocType | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findByIdAndDelete < ResultDoc = THydratedDocumentType > ( id : any , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findByIdAndDelete < ResultDoc = THydratedDocumentType > ( id ?: any , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findByIdAndUpdate < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true ; } , ) : QueryWithHelpers < ModifyResult < TRawDocType > , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findByIdAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true ; } , ) : QueryWithHelpers < ModifyResult < TRawDocType > , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findByIdAndUpdate < ResultDoc = THydratedDocumentType > ( id : any , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < TRawDocType | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findByIdAndUpdate < ResultDoc = THydratedDocumentType > ( id : any , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findByIdAndUpdate < ResultDoc = THydratedDocumentType > ( id : any , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)
, ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType : ResultDoc , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findByIdAndUpdate < ResultDoc = THydratedDocumentType > ( id ?: any , update ?: UpdateQuery < TRawDocType > , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOne < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , projection : ProjectionType < TRawDocType > | null | undefined , options : QueryOptions < TRawDocType > & { lean : true } & Abortable , ) : QueryWithHelpers < TRawDocType | null , ResultDoc , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > ; findOne ( filter : Query < any , any > , projection : ProjectionType < TRawDocType > | null | undefined , options : QueryOptions < TRawDocType > & { lean : true } & Abortable , ) : QueryWithHelpers < TRawDocType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > ; findOne < ResultDoc = THydratedDocumentType > ( filter ?: QueryFilter < TRawDocType > , projection ?: ProjectionType < TRawDocType > | null , options ?: QueryOptions < TRawDocType > & Abortable | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > ; findOne ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , projection ?: ProjectionType < TRawDocType > | null , options ?: QueryOptions < TRawDocType > & Abortable | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : THydratedDocumentType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > ; findOneAndDelete < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < TRawDocType | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findOneAndDelete ( filter : Query < any , any > , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < TRawDocType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findOneAndDelete < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findOneAndDelete ( filter : Query < any , any > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < THydratedDocumentType > , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findOneAndDelete < ResultDoc = THydratedDocumentType > ( filter ?: QueryFilter < TRawDocType > | null , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findOneAndDelete ( filter ?: | Query < any , any , {} , unknown , "find" , Record < string , never > > | null , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : THydratedDocumentType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > ; findOneAndReplace < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , replacement : AnyObject | TRawDocType , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < TRawDocType | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > ; findOneAndReplace ( filter : Query < any , any > , replacement : AnyObject | TRawDocType , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < TRawDocType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > ; findOneAndReplace < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , replacement : AnyObject | TRawDocType , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > ; findOneAndReplace ( filter : Query < any , any > , replacement : AnyObject | TRawDocType , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < THydratedDocumentType > , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > ; findOneAndReplace < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , replacement : AnyObject | TRawDocType , options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)
, ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType : ResultDoc , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > ; findOneAndReplace ( filter : Query < any , any > , replacement : AnyObject | TRawDocType , options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)
, ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType : THydratedDocumentType , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > ; findOneAndReplace < ResultDoc = THydratedDocumentType > ( filter ?: QueryFilter < TRawDocType > , replacement ?: AnyObject | TRawDocType , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > ; findOneAndReplace ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , replacement ?: AnyObject | TRawDocType , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : THydratedDocumentType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true ; } , ) : QueryWithHelpers < ModifyResult < TRawDocType > , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true ; } , ) : QueryWithHelpers < ModifyResult < TRawDocType > , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < | (
TRawDocType extends any [] ? (
Require_id < TRawDocType > extends { __v ?: U } ? { __v ?: U } & Require_id < TRawDocType > : Require_id < TRawDocType > & { __v : number } )
[] : Require_id < TRawDocType > extends { __v ?: U } ? { __v ?: U } & Require_id < TRawDocType > : Require_id < TRawDocType > & { __v : number } )
| null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < | (
TRawDocType extends any [] ? (
Require_id < TRawDocType > extends { __v ?: U } ? { __v ?: U } & Require_id < TRawDocType > : Require_id < TRawDocType > & { __v : number } )
[] : Require_id < TRawDocType > extends { __v ?: U } ? { __v ?: U } & Require_id < TRawDocType > : Require_id < TRawDocType > & { __v : number } )
| null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < THydratedDocumentType > , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate < ResultDoc = THydratedDocumentType > ( filter : QueryFilter < TRawDocType > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)
, ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType : ResultDoc , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)
, ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType : THydratedDocumentType , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate < ResultDoc = THydratedDocumentType > ( filter ?: QueryFilter < TRawDocType > , update ?: UpdateQuery < TRawDocType > , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; findOneAndUpdate < ResultDoc = THydratedDocumentType > ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , update ?: UpdateQuery < TRawDocType > , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > ; getMaxListeners () : number ; hydrate ( obj : any , projection ?: ProjectionType < TRawDocType > , options ?: HydrateOptions , ) : THydratedDocumentType ; init () : Promise < THydratedDocumentType > ; insertMany ( docs : TRawDocType [] ) : Promise < THydratedDocumentType [] > ; insertMany ( doc : TRawDocType [] , options : InsertManyOptions & { ordered : false ; rawResult : true } , ) : Promise < InsertManyResult < Require_id < TRawDocType > > & { mongoose : { results : (
Object | THydratedDocumentType | Error )
[] ; validationErrors : (
CastError | ValidatorError )
[] ; } ; } , > ; insertMany ( docs : TRawDocType [] , options : InsertManyOptions & { lean : true ; rawResult : true } , ) : Promise < InsertManyResult < Require_id < TRawDocType > > > ; insertMany < DocContents = TRawDocType > ( doc : TRawDocType | DocContents , options : InsertManyOptions & { ordered : false ; rawResult : true } , ) : Promise < InsertManyResult < Require_id < DocContents > > & { mongoose : { results : (
Object | Error | MergeType < THydratedDocumentType , DocContents > )
[] ; validationErrors : (
CastError | ValidatorError )
[] ; } ; } , > ; insertMany ( docs : TRawDocType [] , options : InsertManyOptions & { lean : true } , ) : Promise < Require_id < TRawDocType > [] > ; insertMany ( docs : TRawDocType [] , options : InsertManyOptions & { rawResult : true } , ) : Promise < InsertManyResult < Require_id < THydratedDocumentType > > > ; insertMany < DocContents = TRawDocType > ( docs : (
TRawDocType | DocContents )
[] , options : InsertManyOptions & { lean : true } , ) : Promise < Require_id < DocContents > [] > ; insertMany < DocContents = TRawDocType > ( docs : (
TRawDocType | DocContents )
[] , options : InsertManyOptions & { rawResult : true } , ) : Promise < InsertManyResult < Require_id < DocContents > > > ; insertMany < DocContents = TRawDocType > ( doc : DocContents , options : InsertManyOptions & { lean : true } , ) : Promise < Require_id < DocContents > [] > ; insertMany < DocContents = TRawDocType > ( doc : DocContents , options : InsertManyOptions & { rawResult : true } , ) : Promise < InsertManyResult < Require_id < DocContents > > > ; insertMany ( doc : TRawDocType [] , options : InsertManyOptions , ) : Promise < THydratedDocumentType [] > ; insertMany < DocContents = TRawDocType > ( docs : (
TRawDocType | DocContents )
[] , ) : Promise < MergeType < THydratedDocumentType , Omit < DocContents , "_id" > > [] > ; insertMany < DocContents = TRawDocType > ( doc : DocContents , options : InsertManyOptions , ) : Promise < MergeType < THydratedDocumentType , Omit < DocContents , "_id" > > [] > ; insertMany < DocContents = TRawDocType > ( docs : (
TRawDocType | DocContents )
[] , options : InsertManyOptions , ) : Promise < MergeType < THydratedDocumentType , Omit < DocContents , "_id" > > [] > ; insertMany < DocContents = TRawDocType > ( doc : DocContents , ) : Promise < MergeType < THydratedDocumentType , Omit < DocContents , "_id" > > [] > ; insertOne ( doc : Partial < ApplyBasicCreateCasting < TRawDocType > > , options ?: SaveOptions , ) : Promise < THydratedDocumentType > ; listenerCount < E extends string | symbol > ( eventName : string | symbol , listener ?: ( ... args : any [] ) => void , ) : number ; listeners < E extends string | symbol > ( eventName : string | symbol , ) : (
( ... args : any [] ) => void )
[] ; listIndexes () : Promise < any [] > ; listSearchIndexes ( options ?: ListSearchIndexesOptions , ) : Promise < { name : string } [] > ; off < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this ; on < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this ; once < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this ; populate ( docs : any [] , options : string | PopulateOptions | PopulateOptions [] , ) : Promise < THydratedDocumentType [] > ; populate ( doc : any , options : string | PopulateOptions | PopulateOptions [] , ) : Promise < THydratedDocumentType > ; populate < Paths > ( docs : any [] , options : string | PopulateOptions | PopulateOptions [] , ) : Promise < MergeType < THydratedDocumentType , Paths > [] > ; populate < Paths > ( doc : any , options : string | PopulateOptions | PopulateOptions [] , ) : Promise < MergeType < THydratedDocumentType , Paths > > ; prependListener < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this ; prependOnceListener < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this ; rawListeners < E extends string | symbol > ( eventName : string | symbol , ) : (
( ... args : any [] ) => void )
[] ; recompileSchema () : void ; removeAllListeners < E extends string | symbol > ( eventName ?: string | symbol , ) : this ; removeListener < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this ; replaceOne < ResultDoc = THydratedDocumentType > ( filter ?: QueryFilter < TRawDocType > , replacement ?: AnyObject | TRawDocType , options ?: ReplaceOptions & QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < UpdateWriteOpResult , ResultDoc , TQueryHelpers , TRawDocType , "replaceOne" , TInstanceMethods & TVirtuals , > ; replaceOne < ResultDoc = THydratedDocumentType > ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , replacement ?: AnyObject | TRawDocType , options ?: ReplaceOptions & QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < UpdateWriteOpResult , ResultDoc , TQueryHelpers , TRawDocType , "replaceOne" , TInstanceMethods & TVirtuals , > ; setMaxListeners ( n : number ) : this ; startSession ( options ?: ClientSessionOptions ) : Promise < ClientSession > ; syncIndexes ( options ?: SyncIndexesOptions ) : Promise < string [] > ; translateAliases ( raw : any ) : any ; updateMany ( filter : QueryFilter < TRawDocType > , update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > , options ?: UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null , ) : QueryWithHelpers < UpdateWriteOpResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "updateMany" , TInstanceMethods & TVirtuals , > ; updateMany ( filter : Query < any , any > , update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > , options ?: UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null , ) : QueryWithHelpers < UpdateWriteOpResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "updateMany" , TInstanceMethods & TVirtuals , > ; updateOne ( filter : QueryFilter < TRawDocType > , update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > , options ?: UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null , ) : QueryWithHelpers < UpdateWriteOpResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "updateOne" , TInstanceMethods & TVirtuals , > ; updateOne ( filter : Query < any , any > , update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > , options ?: UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null , ) : QueryWithHelpers < UpdateWriteOpResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "updateOne" , TInstanceMethods & TVirtuals , > ; updateSearchIndex ( name : string , definition : AnyObject ) : Promise < void > ; useConnection ( connection : Connection ) : this ; validate () : Promise < void > ; validate ( obj : any ) : Promise < void > ; validate ( obj : any , pathsOrOptions : PathsToValidate ) : Promise < void > ; validate ( obj : any , pathsOrOptions : { pathsToSkip ?: pathsToSkip } , ) : Promise < void > ; watch < ResultType extends Document = any , ChangeType extends ChangeStreamDocument < Document > = any , > ( pipeline ?: Record < string , unknown > [] , options ?: ChangeStreamOptions & { hydrate ?: boolean } , ) : ChangeStream < ResultType , ChangeType > ; where < ResultDoc = THydratedDocumentType > ( path : string , val ?: any , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType [] : ResultDoc [] , ResultDoc , TQueryHelpers , TRawDocType , "find" , TInstanceMethods , > ; where < ResultDoc = THydratedDocumentType > ( obj : object , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType [] : ResultDoc [] , ResultDoc , TQueryHelpers , TRawDocType , "find" , TInstanceMethods & TVirtuals , > ; where < ResultDoc = THydratedDocumentType > () : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType [] : ResultDoc [] , ResultDoc , TQueryHelpers , TRawDocType , "find" , TInstanceMethods & TVirtuals , > ; } Constructors constructor Parameters Optionaldoc : DocType Optionalfields : any Optionaloptions : AnyObject Inherited from Model<TRawDocType, TQueryHelpers, TInstanceMethods, TVirtuals, THydratedDocumentType, TSchema>.constructor
Properties base Model Name baseModelName : string | undefined
collection collection : Collection
db db : Connection
Inherited from Model.db
Defined in node_modules/mongoose/types/models.d.ts:378 discriminators discriminators : | { [ name : string ]: Model < any , {} , {} , {} , any , any , any > } | undefined
events events : EventEmitter
model Name modelName : string
Methods Optional[capture Rejection Symbol] "[captureRejectionSymbol]" ? ( error : Error , event : string | symbol , ... args : any [] , ) : void Parameters error : Error event : string | symbol ... args : any [] Returns void $where Parameters argument : string | Function add Listener addListener < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this Type Parameters E extends string | symbol Parameters eventName : string | symbol listener : ( ... args : any [] ) => void Returns this aggregate aggregate < R = any > ( pipeline ?: PipelineStage [] , options ?: AggregateOptions , ) : Aggregate < R [] > Parameters Optionalpipeline : PipelineStage [] Optionaloptions : AggregateOptions Returns Aggregate < R [] > aggregate < R = any > ( pipeline : PipelineStage [] ) : Aggregate < R [] > Parameters pipeline : PipelineStage [] Returns Aggregate < R [] > apply Defaults applyDefaults ( obj : AnyObject ) : AnyObject apply Timestamps applyTimestamps ( obj : AnyObject , options ?: { currentTime ?: () => Date ; isUpdate ?: boolean } , ) : AnyObject Parameters obj : AnyObject Optionaloptions : { currentTime ?: () => Date ; isUpdate ?: boolean } Returns AnyObject apply Virtuals applyVirtuals ( obj : AnyObject , virtalsToApply ?: string [] ) : AnyObject Parameters obj : AnyObject OptionalvirtalsToApply : string [] Returns AnyObject bulk Save bulkSave ( documents : Document < ObjectId , any , any , Record < string , any > , {} > [] , options ?: MongooseBulkSaveOptions , ) : Promise < MongooseBulkWriteResult > Parameters documents : Document < ObjectId , any , any , Record < string , any > , {} > [] Optionaloptions : MongooseBulkSaveOptions Returns Promise < MongooseBulkWriteResult > bulk Write bulkWrite < DocContents = TRawDocType > ( writes : AnyBulkWriteOperation < DocContents extends Document ? DocContents < DocContents > : any , > [] , options : BulkWriteOptions & MongooseBulkWriteOptions & { ordered : false } , ) : Promise < BulkWriteResult & { mongoose ?: { validationErrors : Error [] } } > Parameters writes : AnyBulkWriteOperation < DocContents extends Document ? DocContents < DocContents > : any , > [] options : BulkWriteOptions & MongooseBulkWriteOptions & { ordered : false } Returns Promise < BulkWriteResult & { mongoose ?: { validationErrors : Error [] } } > Returns Promise < BulkWriteResult > cast Object castObject ( obj : AnyObject , options ?: { ignoreCastErrors ?: boolean } , ) : TRawDocType Parameters obj : AnyObject Optionaloptions : { ignoreCastErrors ?: boolean } clean Indexes cleanIndexes ( options ?: { hideIndexes ?: boolean ; toDrop ?: string [] } , ) : Promise < string [] > Parameters Optionaloptions : { hideIndexes ?: boolean ; toDrop ?: string [] } Returns Promise < string [] > client Encryption clientEncryption () : ClientEncryption | null Returns ClientEncryption | null count Documents countDocuments ( filter ?: QueryFilter < TRawDocType > , options ?: | CountOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } & Abortable | null , ) : QueryWithHelpers < number , THydratedDocumentType , TQueryHelpers , TRawDocType , "countDocuments" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : QueryFilter < TRawDocType > Optionaloptions : | CountOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } & Abortable | null countDocuments ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , options ?: | CountOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } & Abortable | null , ) : QueryWithHelpers < number , THydratedDocumentType , TQueryHelpers , TRawDocType , "countDocuments" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > Optionaloptions : | CountOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } & Abortable | null create Parameters doc : Partial < TRawDocType > create ( docs : DeepPartial < ApplyBasicCreateCasting < Require_id < TRawDocType > > > [] , options : CreateOptions & { aggregateErrors : true } , ) : Promise < (
THydratedDocumentType | Error )
[] > Parameters docs : DeepPartial < ApplyBasicCreateCasting < Require_id < TRawDocType > > > [] options : CreateOptions & { aggregateErrors : true } Parameters docs : DeepPartial < ApplyBasicCreateCasting < Require_id < TRawDocType > > > [] Optionaloptions : CreateOptions Parameters doc : DeepPartial < ApplyBasicCreateCasting < Require_id < TRawDocType > > > Parameters ... docs : DeepPartial < ApplyBasicCreateCasting < Require_id < TRawDocType > > > [] create Collection createCollection < T extends Document > ( options ?: CreateCollectionOptions & Pick < SchemaOptions < unknown , {} , {} , {} , {} , Document < unknown , {} , unknown , {} , DefaultSchemaOptions > & { _id : ObjectId ; } & { __v : number } & { id : string } , Model < unknown , {} , {} , {} , Document < unknown , {} , unknown , {} , DefaultSchemaOptions > & { _id : ObjectId ; } & { __v : number } & { id : string } , any , unknown , > , > , "expires" , > , ) : Promise < Collection < T > > Parameters Optionaloptions : CreateCollectionOptions & Pick < SchemaOptions < unknown , {} , {} , {} , {} , Document < unknown , {} , unknown , {} , DefaultSchemaOptions > & { _id : ObjectId ; } & { __v : number } & { id : string } , Model < unknown , {} , {} , {} , Document < unknown , {} , unknown , {} , DefaultSchemaOptions > & { _id : ObjectId ; } & { __v : number } & { id : string } , any , unknown , > , > , "expires" , > Returns Promise < Collection < T > > create Indexes createIndexes ( options ?: CreateIndexesOptions ) : Promise < void > Parameters Optionaloptions : CreateIndexesOptions Returns Promise < void > create Search Index createSearchIndex ( description : SearchIndexDescription ) : Promise < string > Parameters description : SearchIndexDescription Returns Promise < string > create Search Indexes createSearchIndexes () : Promise < string [] > Returns Promise < string [] > delete Many deleteMany ( filter ?: QueryFilter < TRawDocType > , options ?: | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null , ) : QueryWithHelpers < DeleteResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "deleteMany" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : QueryFilter < TRawDocType > Optionaloptions : | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null deleteMany ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , options ?: | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null , ) : QueryWithHelpers < DeleteResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "deleteMany" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > Optionaloptions : | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null delete One deleteOne ( filter ?: QueryFilter < TRawDocType > , options ?: | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null , ) : QueryWithHelpers < DeleteResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "deleteOne" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : QueryFilter < TRawDocType > Optionaloptions : | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null deleteOne ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , options ?: | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null , ) : QueryWithHelpers < DeleteResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "deleteOne" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > Optionaloptions : | DeleteOptions & Pick < QueryOptions < TRawDocType > , MongooseBaseQueryOptionKeys | "timestamps" | "lean" , > & { [ other : string ]: any } | null diff Indexes diffIndexes ( options ?: Record < string , unknown > ) : Promise < IndexesDiff > Parameters Optionaloptions : Record < string , unknown > Returns Promise < IndexesDiff > discriminator discriminator < TDiscriminatorSchema extends Schema < any , any , {} , {} , {} , {} , DefaultSchemaOptions , { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } , Document < unknown , {} , { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } , { id : string } , ResolveSchemaOptions < DefaultSchemaOptions > , > & Omit < { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } & Required < { _id : unknown } > & { __v : number } , "id" , > & { id : string } , | { [ path : string ]: SchemaDefinitionProperty < undefined , any , any > } | { [ key : string ]: | SchemaDefinitionProperty < any , any , Document < unknown , {} , { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } , { id : string } , ResolveSchemaOptions < DefaultSchemaOptions > , > & Omit < { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } & Required < { _id : unknown } > & { __v : number } , "id" , > & { id : string } , > | undefined ; } , { [ key : number ]: {} ; [ key : symbol ]: {} ; [ key : string ]: {} } & Required < { _id : unknown } , > & { __v : number } , > , > ( name : string | number , schema : TDiscriminatorSchema , value ?: string | number | ObjectId | DiscriminatorOptions , ) : Model < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , TQueryHelpers & ObtainSchemaGeneric < TDiscriminatorSchema , "TQueryHelpers" > , TInstanceMethods & ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" , > , TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > , IfAny < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , any , (
TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > & TInstanceMethods & ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" , > )
extends Record < string , never > ? Document < unknown , TQueryHelpers & ObtainSchemaGeneric < TDiscriminatorSchema , "TQueryHelpers" , > , TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > , DefaultSchemaOptions , > & Require_id < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , > & { __v : number } & AddDefaultId < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , {} , DefaultSchemaOptions , > : IfAny < TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > & TInstanceMethods & ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" , > , Document < unknown , TQueryHelpers & ObtainSchemaGeneric < TDiscriminatorSchema , "TQueryHelpers" , > , TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > , DefaultSchemaOptions , > & Require_id < TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , > & { __v : number } , Document < unknown , TQueryHelpers & ObtainSchemaGeneric < TDiscriminatorSchema , "TQueryHelpers" , > , TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > , DefaultSchemaOptions , > & Omit < Require_id < TRawDocType & IfAny < (...)
, (...)
, (...)
> > & { __v : number ; } , | keyof TVirtuals | keyof ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > | keyof TInstanceMethods | keyof ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" > , > & TVirtuals & ObtainSchemaGeneric < TDiscriminatorSchema , "TVirtuals" > & TInstanceMethods & ObtainSchemaGeneric < TDiscriminatorSchema , "TInstanceMethods" , > , > , > , any , TRawDocType & IfAny < TDiscriminatorSchema , any , ObtainSchemaGeneric < TDiscriminatorSchema , "DocType" > , > , > & ObtainSchemaGeneric < TSchema , "TStaticMethods" > & ObtainSchemaGeneric < TDiscriminatorSchema , "TStaticMethods" , > Type Parameters TDiscriminatorSchema extends Schema < any , any , {} , {} , {} , {} , DefaultSchemaOptions , { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown } , Document < unknown , {} , { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown } , { id : string } , ResolveSchemaOptions < DefaultSchemaOptions > , > & Omit < { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } & Required < { _id : unknown } > & { __v : number } , "id" , > & { id : string } , | { [ path : string ]: SchemaDefinitionProperty < undefined , any , any > } | { [ key : string ]: | SchemaDefinitionProperty < any , any , Document < unknown , {} , { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } , { id : string } , ResolveSchemaOptions < DefaultSchemaOptions > , > & Omit < { [ key : number ]: unknown ; [ key : symbol ]: unknown ; [ key : string ]: unknown ; } & Required < { _id : unknown } > & { __v : number } , "id" , > & { id : string } , > | undefined ; } , { [ key : number ]: {} ; [ key : symbol ]: {} ; [ key : string ]: {} } & Required < { _id : unknown } , > & { __v : number } , > Parameters name : string | number schema : TDiscriminatorSchema Optionalvalue : string | number | ObjectId | DiscriminatorOptions discriminator < D > ( name : string | number , schema : Schema , value ?: string | number | ObjectId | DiscriminatorOptions , ) : Model < D > Parameters name : string | number schema : Schema Optionalvalue : string | number | ObjectId | DiscriminatorOptions Returns Model < D > discriminator < T , U > ( name : string | number , schema : Schema < T , U > , value ?: string | number | ObjectId | DiscriminatorOptions , ) : U Parameters name : string | number schema : Schema < T , U > Optionalvalue : string | number | ObjectId | DiscriminatorOptions Returns U distinct distinct < DocKey extends string > ( field : DocKey , filter ?: QueryFilter < TRawDocType > , options ?: QueryOptions < TRawDocType > , ) : QueryWithHelpers < (
DocKey extends keyof WithLevel1NestedPaths < TRawDocType , keyof TRawDocType , > ? WithoutUndefined < Unpacked < WithLevel1NestedPaths < TRawDocType , keyof TRawDocType > [ DocKey < DocKey > ] , > , > : unknown )
[] , THydratedDocumentType , TQueryHelpers , TRawDocType , "distinct" , TInstanceMethods & TVirtuals , > distinct < DocKey extends string > ( field : DocKey , filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , options ?: QueryOptions < TRawDocType > , ) : QueryWithHelpers < (
DocKey extends keyof WithLevel1NestedPaths < TRawDocType , keyof TRawDocType , > ? WithoutUndefined < Unpacked < WithLevel1NestedPaths < TRawDocType , keyof TRawDocType > [ DocKey < DocKey > ] , > , > : unknown )
[] , THydratedDocumentType , TQueryHelpers , TRawDocType , "distinct" , TInstanceMethods & TVirtuals , > Parameters field : DocKey Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > Optionaloptions : QueryOptions < TRawDocType > drop Search Index dropSearchIndex ( name : string ) : Promise < void > emit emit < E extends string | symbol > ( eventName : string | symbol , ... args : any [] , ) : boolean Type Parameters E extends string | symbol Parameters eventName : string | symbol ... args : any [] Returns boolean ensure Indexes ensureIndexes ( options ?: CreateIndexesOptions ) : Promise < void > Parameters Optionaloptions : CreateIndexesOptions Returns Promise < void > event Names eventNames () : (
string | symbol )
[] Returns (string | symbol )[] find find ( filter : Query < any , any > , projection : ProjectionType < TRawDocType > | null | undefined , options : QueryOptions < TRawDocType > & { lean : true } & Abortable , ) : QueryWithHelpers < (
Require_id < TRawDocType > extends { __v ?: U } ? { __v ?: U } & Require_id < TRawDocType > : Require_id < TRawDocType > & { __v : number } )
[] , THydratedDocumentType , TQueryHelpers , TRawDocType , "find" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > projection : ProjectionType < TRawDocType > | null | undefined options : QueryOptions < TRawDocType > & { lean : true } & Abortable find ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , projection ?: ProjectionType < TRawDocType > | null , options ?: QueryOptions < TRawDocType > & Abortable , ) : QueryWithHelpers < THydratedDocumentType [] , THydratedDocumentType , TQueryHelpers , TRawDocType , "find" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > Optionalprojection : ProjectionType < TRawDocType > | null Optionaloptions : QueryOptions < TRawDocType > & Abortable find By Id Parameters id : any projection : ProjectionType < TRawDocType > | null | undefined options : QueryOptions < TRawDocType > & { lean : true } Parameters Optionalid : any Optionalprojection : ProjectionType < TRawDocType > | null Optionaloptions : QueryOptions < TRawDocType > | null find By Id And Delete Parameters id : any options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true } Parameters id : any options : QueryOptions < TRawDocType > & { lean : true } Parameters id : any options : QueryOptions < TRawDocType > & { includeResultMetadata : true } Parameters Optionalid : any Optionaloptions : QueryOptions < TRawDocType > | null find By Id And Update findByIdAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true ; } , ) : QueryWithHelpers < ModifyResult < TRawDocType > , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > update : UpdateQuery < TRawDocType > options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true } Parameters id : any update : UpdateQuery < TRawDocType > options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)find One findOne ( filter : Query < any , any > , projection : ProjectionType < TRawDocType > | null | undefined , options : QueryOptions < TRawDocType > & { lean : true } & Abortable , ) : QueryWithHelpers < TRawDocType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > projection : ProjectionType < TRawDocType > | null | undefined options : QueryOptions < TRawDocType > & { lean : true } & Abortable findOne ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , projection ?: ProjectionType < TRawDocType > | null , options ?: QueryOptions < TRawDocType > & Abortable | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : THydratedDocumentType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOne" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > Optionalprojection : ProjectionType < TRawDocType > | null Optionaloptions : QueryOptions < TRawDocType > & Abortable | null find One And Delete Parameters filter : Query < any , any > options : QueryOptions < TRawDocType > & { lean : true } Parameters filter : Query < any , any > options : QueryOptions < TRawDocType > & { includeResultMetadata : true } findOneAndDelete ( filter ?: | Query < any , any , {} , unknown , "find" , Record < string , never > > | null , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : THydratedDocumentType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndDelete" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > | null Optionaloptions : QueryOptions < TRawDocType > | null find One And Replace findOneAndReplace ( filter : Query < any , any > , replacement : AnyObject | TRawDocType , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < TRawDocType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > replacement : AnyObject | TRawDocType options : QueryOptions < TRawDocType > & { lean : true } findOneAndReplace ( filter : Query < any , any > , replacement : AnyObject | TRawDocType , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < THydratedDocumentType > , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > replacement : AnyObject | TRawDocType options : QueryOptions < TRawDocType > & { includeResultMetadata : true } findOneAndReplace ( filter : Query < any , any > , replacement : AnyObject | TRawDocType , options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)
, ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType : THydratedDocumentType , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > replacement : AnyObject | TRawDocType options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)findOneAndReplace ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , replacement ?: AnyObject | TRawDocType , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : THydratedDocumentType | null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndReplace" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > Optionalreplacement : AnyObject | TRawDocType Optionaloptions : QueryOptions < TRawDocType > | null find One And Update findOneAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true ; } , ) : QueryWithHelpers < ModifyResult < TRawDocType > , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > update : UpdateQuery < TRawDocType > options : QueryOptions < TRawDocType > & { includeResultMetadata : true ; lean : true } findOneAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { lean : true } , ) : QueryWithHelpers < | (
TRawDocType extends any [] ? (
Require_id < TRawDocType > extends { __v ?: U } ? { __v ?: U } & Require_id < TRawDocType > : Require_id < TRawDocType > & { __v : number } )
[] : Require_id < TRawDocType > extends { __v ?: U } ? { __v ?: U } & Require_id < TRawDocType > : Require_id < TRawDocType > & { __v : number } )
| null , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > findOneAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & { includeResultMetadata : true } , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? ModifyResult < TRawDocType > : ModifyResult < THydratedDocumentType > , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > update : UpdateQuery < TRawDocType > options : QueryOptions < TRawDocType > & { includeResultMetadata : true } findOneAndUpdate ( filter : Query < any , any > , update : UpdateQuery < TRawDocType > , options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)
, ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType : THydratedDocumentType , THydratedDocumentType , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > update : UpdateQuery < TRawDocType > options : QueryOptions < TRawDocType > & ({ upsert: true; } & ReturnsNewDoc)findOneAndUpdate < ResultDoc = THydratedDocumentType > ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , update ?: UpdateQuery < TRawDocType > , options ?: QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < HasLeanOption < TSchema > extends true ? TRawDocType | null : ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , "findOneAndUpdate" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > Optionalupdate : UpdateQuery < TRawDocType > Optionaloptions : QueryOptions < TRawDocType > | null get Max Listeners getMaxListeners () : number hydrate Parameters obj : any Optionalprojection : ProjectionType < TRawDocType > Optionaloptions : HydrateOptions insert Many insertMany ( doc : TRawDocType [] , options : InsertManyOptions & { ordered : false ; rawResult : true } , ) : Promise < InsertManyResult < Require_id < TRawDocType > > & { mongoose : { results : (
Object | THydratedDocumentType | Error )
[] ; validationErrors : (
CastError | ValidatorError )
[] ; } ; } , > Parameters doc : TRawDocType [] options : InsertManyOptions & { ordered : false ; rawResult : true } Returns Promise < InsertManyResult < Require_id < TRawDocType > > & { mongoose : { results : (Object | THydratedDocumentType | Error )[] ; validationErrors : (CastError | ValidatorError )[] ; } ; } , > insertMany ( docs : TRawDocType [] , options : InsertManyOptions & { lean : true ; rawResult : true } , ) : Promise < InsertManyResult < Require_id < TRawDocType > > > Parameters docs : TRawDocType [] options : InsertManyOptions & { lean : true ; rawResult : true } Returns Promise < InsertManyResult < Require_id < TRawDocType > > > insertMany ( docs : TRawDocType [] , options : InsertManyOptions & { lean : true } , ) : Promise < Require_id < TRawDocType > [] > Parameters docs : TRawDocType [] options : InsertManyOptions & { lean : true } Returns Promise < Require_id < TRawDocType > [] > Returns Promise < InsertManyResult < Require_id < DocContents > > > Parameters doc : DocContents options : InsertManyOptions & { lean : true } Returns Promise < Require_id < DocContents > [] > Parameters doc : DocContents options : InsertManyOptions & { rawResult : true } Returns Promise < InsertManyResult < Require_id < DocContents > > > insert One insertOne ( doc : Partial < ApplyBasicCreateCasting < TRawDocType > > , options ?: SaveOptions , ) : Promise < THydratedDocumentType > Parameters doc : Partial < ApplyBasicCreateCasting < TRawDocType > > Optionaloptions : SaveOptions listener Count listenerCount < E extends string | symbol > ( eventName : string | symbol , listener ?: ( ... args : any [] ) => void , ) : number Type Parameters E extends string | symbol Parameters eventName : string | symbol Optionallistener : ( ... args : any [] ) => void Returns number listeners listeners < E extends string | symbol > ( eventName : string | symbol , ) : (
( ... args : any [] ) => void )
[] Type Parameters E extends string | symbol Parameters eventName : string | symbol Returns (( ... args : any [] ) => void )[] list Indexes listIndexes () : Promise < any [] > list Search Indexes listSearchIndexes ( options ?: ListSearchIndexesOptions , ) : Promise < { name : string } [] > Parameters Optionaloptions : ListSearchIndexesOptions Returns Promise < { name : string } [] > off off < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this Type Parameters E extends string | symbol Parameters eventName : string | symbol listener : ( ... args : any [] ) => void Returns this Inherited from Model.off
Defined in node_modules/@types/node/events.d.ts:227 on on < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this Type Parameters E extends string | symbol Parameters eventName : string | symbol listener : ( ... args : any [] ) => void Returns this Inherited from Model.on
Defined in node_modules/@types/node/events.d.ts:261 once once < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this Type Parameters E extends string | symbol Parameters eventName : string | symbol listener : ( ... args : any [] ) => void Returns this populate populate ( docs : any [] , options : string | PopulateOptions | PopulateOptions [] , ) : Promise < THydratedDocumentType [] > Parameters docs : any [] options : string | PopulateOptions | PopulateOptions [] populate ( doc : any , options : string | PopulateOptions | PopulateOptions [] , ) : Promise < THydratedDocumentType > Parameters doc : any options : string | PopulateOptions | PopulateOptions [] Parameters docs : any [] options : string | PopulateOptions | PopulateOptions [] Parameters doc : any options : string | PopulateOptions | PopulateOptions [] prepend Listener prependListener < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this Type Parameters E extends string | symbol Parameters eventName : string | symbol listener : ( ... args : any [] ) => void Returns this prepend Once Listener prependOnceListener < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this Type Parameters E extends string | symbol Parameters eventName : string | symbol listener : ( ... args : any [] ) => void Returns this raw Listeners rawListeners < E extends string | symbol > ( eventName : string | symbol , ) : (
( ... args : any [] ) => void )
[] Type Parameters E extends string | symbol Parameters eventName : string | symbol Returns (( ... args : any [] ) => void )[] remove All Listeners removeAllListeners < E extends string | symbol > ( eventName ?: string | symbol ) : this Type Parameters E extends string | symbol Parameters OptionaleventName : string | symbol Returns this remove Listener removeListener < E extends string | symbol > ( eventName : string | symbol , listener : ( ... args : any [] ) => void , ) : this Type Parameters E extends string | symbol Parameters eventName : string | symbol listener : ( ... args : any [] ) => void Returns this replace One replaceOne < ResultDoc = THydratedDocumentType > ( filter ?: Query < any , any , {} , unknown , "find" , Record < string , never > > , replacement ?: AnyObject | TRawDocType , options ?: ReplaceOptions & QueryOptions < TRawDocType > | null , ) : QueryWithHelpers < UpdateWriteOpResult , ResultDoc , TQueryHelpers , TRawDocType , "replaceOne" , TInstanceMethods & TVirtuals , > Parameters Optionalfilter : Query < any , any , {} , unknown , "find" , Record < string , never > > Optionalreplacement : AnyObject | TRawDocType Optionaloptions : ReplaceOptions & QueryOptions < TRawDocType > | null set Max Listeners setMaxListeners ( n : number ) : this start Session startSession ( options ?: ClientSessionOptions ) : Promise < ClientSession > Parameters Optionaloptions : ClientSessionOptions Returns Promise < ClientSession > sync Indexes syncIndexes ( options ?: SyncIndexesOptions ) : Promise < string [] > Parameters Optionaloptions : SyncIndexesOptions Returns Promise < string [] > translate Aliases translateAliases ( raw : any ) : any update Many Parameters filter : QueryFilter < TRawDocType > update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > Optionaloptions : UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null updateMany ( filter : Query < any , any > , update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > , options ?: UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null , ) : QueryWithHelpers < UpdateWriteOpResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "updateMany" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > Optionaloptions : UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null update One Parameters filter : QueryFilter < TRawDocType > update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > Optionaloptions : UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null updateOne ( filter : Query < any , any > , update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > , options ?: UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null , ) : QueryWithHelpers < UpdateWriteOpResult , THydratedDocumentType , TQueryHelpers , TRawDocType , "updateOne" , TInstanceMethods & TVirtuals , > Parameters filter : Query < any , any > update : UpdateWithAggregationPipeline | UpdateQuery < TRawDocType > Optionaloptions : UpdateOptions & MongooseUpdateQueryOptions < TRawDocType > | null update Search Index updateSearchIndex ( name : string , definition : AnyObject ) : Promise < void > Parameters name : string definition : AnyObject Returns Promise < void > use Connection useConnection ( connection : Connection ) : this validate validate () : Promise < void > validate ( obj : any ) : Promise < void > validate ( obj : any , pathsOrOptions : PathsToValidate ) : Promise < void > Parameters obj : any pathsOrOptions : PathsToValidate Returns Promise < void > validate ( obj : any , pathsOrOptions : { pathsToSkip ?: pathsToSkip } ) : Promise < void > Parameters obj : any pathsOrOptions : { pathsToSkip ?: pathsToSkip } Returns Promise < void > watch watch < ResultType extends Document = any , ChangeType extends ChangeStreamDocument < Document > = any , > ( pipeline ?: Record < string , unknown > [] , options ?: ChangeStreamOptions & { hydrate ?: boolean } , ) : ChangeStream < ResultType , ChangeType > Type Parameters ResultType extends Document = any ChangeType extends ChangeStreamDocument < Document > = any Parameters Optionalpipeline : Record < string , unknown > [] Optionaloptions : ChangeStreamOptions & { hydrate ?: boolean } where Parameters path : string Optionalval : any
Base Mongoose instance the model uses.