method mongoose.Schema.prototype.preimport { mongoose } from "https://deno.land/x/mongoose@8.7.0/types/index.d.ts"; const { Schema } = mongoose; pre<T = never>(method: "save",options: SchemaPreOptions & { document: false; query: boolean; },fn: PreSaveMiddlewareFunction<T>,): thisDefines a pre hook for the model. pre<T = never>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp,options: SchemaPreOptions & { document: false; query: false; },fn: PreMiddlewareFunction<T>,): thispre<T = never>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[],options: SchemaPreOptions & { document: boolean; query: false; },fn: PreMiddlewareFunction<T>,): thispre<T = never>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[] | RegExp,options: SchemaPreOptions & { document: false; query: boolean; },fn: PreMiddlewareFunction<T>,): thispre<T = THydratedDocumentType | Query<any, any>>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp,options: SchemaPreOptions & { document: true; query: true; },fn: PreMiddlewareFunction<T>,): thispre<T = THydratedDocumentType>(method: "save", fn: PreSaveMiddlewareFunction<T>): thispre<T = THydratedDocumentType>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[], fn: PreMiddlewareFunction<T>): thispre<T = THydratedDocumentType>(method: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[],options: SchemaPreOptions,fn: PreMiddlewareFunction<T>,): thispre<T = THydratedDocumentType>(method: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExp,options: SchemaPreOptions & { document: true; },fn: PreMiddlewareFunction<T>,): thispre<T = THydratedDocumentType>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp,options: SchemaPreOptions & { document: true; query: false; },fn: PreMiddlewareFunction<T>,): thispre<T = Query<any, any>>(method: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[], fn: PreMiddlewareFunction<T>): thispre<T = Query<any, any>>(method: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[],options: SchemaPreOptions,fn: PreMiddlewareFunction<T>,): thispre<T = Query<any, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp,options: SchemaPreOptions & { document: false; query: true; },fn: PreMiddlewareFunction<T>,): thispre<T = THydratedDocumentType | Query<any, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp,options: SchemaPreOptions & { document: true; query: true; },fn: PreMiddlewareFunction<T>,): thispre<T = THydratedDocumentType | Query<any, any>>(method: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExp, fn: PreMiddlewareFunction<T>): thispre<T extends Aggregate<any>>(method: "aggregate" | RegExp, fn: PreMiddlewareFunction<T>): thispre<T = TModelType>(method: "insertMany" | RegExp, fn: (this: T,next: (err?: CallbackError) => void,docs: any | Array<any>,options?: InsertManyOptions & { lean?: boolean; },) => void | Promise<void>): thispre<T = TModelType>(method: "bulkWrite" | RegExp, fn: (this: T,next: (err?: CallbackError) => void,ops: Array<AnyBulkWriteOperation<any>>,options?: mongodb.BulkWriteOptions & MongooseBulkWriteOptions,) => void | Promise<void>): thispre<T = TModelType>(method: "createCollection" | RegExp, fn: (this: T,next: (err?: CallbackError) => void,options?: mongodb.CreateCollectionOptions & Pick<SchemaOptions, "expires">,) => void | Promise<void>): thisDefines a pre hook for the model. Type ParametersoptionalT = neverParametersmethod: "save"options: SchemaPreOptions & { document: false; query: boolean; }fn: PreSaveMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = neverParametersmethod: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExpoptions: SchemaPreOptions & { document: false; query: false; }fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = neverParametersmethod: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[]options: SchemaPreOptions & { document: boolean; query: false; }fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = neverParametersmethod: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[] | RegExpoptions: SchemaPreOptions & { document: false; query: boolean; }fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = THydratedDocumentType | Query<any, any>Parametersmethod: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExpoptions: SchemaPreOptions & { document: true; query: true; }fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = THydratedDocumentTypeParametersmethod: "save"fn: PreSaveMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = THydratedDocumentTypeParametersmethod: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[]fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = THydratedDocumentTypeParametersmethod: MongooseDistinctDocumentMiddleware | MongooseDistinctDocumentMiddleware[]options: SchemaPreOptionsfn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = THydratedDocumentTypeParametersmethod: MongooseQueryAndDocumentMiddleware | MongooseQueryAndDocumentMiddleware[] | RegExpoptions: SchemaPreOptions & { document: true; }fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = THydratedDocumentTypeParametersmethod: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExpoptions: SchemaPreOptions & { document: true; query: false; }fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = Query<any, any>Parametersmethod: MongooseDefaultQueryMiddleware | MongooseDefaultQueryMiddleware[]fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = Query<any, any>Parametersmethod: MongooseDistinctQueryMiddleware | MongooseDistinctQueryMiddleware[]options: SchemaPreOptionsfn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = Query<any, any>Parametersmethod: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExpoptions: SchemaPreOptions & { document: false; query: true; }fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = THydratedDocumentType | Query<any, any>Parametersmethod: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExpoptions: SchemaPreOptions & { document: true; query: true; }fn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = THydratedDocumentType | Query<any, any>Parametersmethod: MongooseQueryOrDocumentMiddleware | MongooseQueryOrDocumentMiddleware[] | RegExpfn: PreMiddlewareFunction<T>ReturnsthisType ParametersT extends Aggregate<any>Parametersmethod: "aggregate" | RegExpfn: PreMiddlewareFunction<T>ReturnsthisType ParametersoptionalT = TModelTypeParametersmethod: "insertMany" | RegExpfn: (this: T,next: (err?: CallbackError) => void,docs: any | Array<any>,options?: InsertManyOptions & { lean?: boolean; },) => void | Promise<void>ReturnsthisType ParametersoptionalT = TModelTypeParametersmethod: "bulkWrite" | RegExpfn: (this: T,next: (err?: CallbackError) => void,ops: Array<AnyBulkWriteOperation<any>>,options?: mongodb.BulkWriteOptions & MongooseBulkWriteOptions,) => void | Promise<void>ReturnsthisType ParametersoptionalT = TModelTypeParametersmethod: "createCollection" | RegExpfn: (this: T,next: (err?: CallbackError) => void,options?: mongodb.CreateCollectionOptions & Pick<SchemaOptions, "expires">,) => void | Promise<void>Returnsthis