Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/mongoose/types/index.d.ts>mongoose.Schema#post

MongoDB object modeling designed to work in an asynchronous environment.
Latest
method mongoose.Schema.prototype.post
import { mongoose } from "https://deno.land/x/mongoose@6.13.4/types/index.d.ts";
const { Schema } = mongoose;

Defines a post hook for the model.

Type Parameters

optional
T = Query<any, any>

Parameters

method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp
options: SchemaPostOptions & { errorHandler: true; }
fn: ErrorHandlingMiddlewareWithOption<T>

Type Parameters

optional
T = HydratedDocument<DocType, TInstanceMethods>

Parameters

method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp
options: SchemaPostOptions & { errorHandler: true; }
fn: ErrorHandlingMiddlewareWithOption<T>

Type Parameters

T extends Aggregate<any>

Parameters

method: "aggregate" | RegExp
options: SchemaPostOptions & { errorHandler: true; }
fn: ErrorHandlingMiddlewareWithOption<T, Array<any>>

Type Parameters

optional
T = M

Parameters

method: "insertMany" | RegExp
options: SchemaPostOptions & { errorHandler: true; }
fn: ErrorHandlingMiddlewareWithOption<T>

Type Parameters

optional
T = Query<any, any>

Parameters

method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp
fn: PostMiddlewareFunction<T, QueryResultType<T>>

Type Parameters

optional
T = Query<any, any>

Parameters

method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp
options: SchemaPostOptions
fn: PostMiddlewareFunction<T, QueryResultType<T>>

Type Parameters

optional
T = HydratedDocument<DocType, TInstanceMethods>

Parameters

method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp
fn: PostMiddlewareFunction<T, T>

Type Parameters

optional
T = HydratedDocument<DocType, TInstanceMethods>

Parameters

method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp
options: SchemaPostOptions
fn: PostMiddlewareFunction<T, T>

Type Parameters

T extends Aggregate<any>

Parameters

method: "aggregate" | RegExp
fn: PostMiddlewareFunction<T, Array<AggregateExtract<T>>>

Type Parameters

T extends Aggregate<any>

Parameters

method: "aggregate" | RegExp
options: SchemaPostOptions
fn: PostMiddlewareFunction<T, Array<AggregateExtract<T>>>

Type Parameters

optional
T = M

Parameters

method: "insertMany" | RegExp
fn: PostMiddlewareFunction<T, T>

Type Parameters

optional
T = M

Parameters

method: "insertMany" | RegExp
options: SchemaPostOptions
fn: PostMiddlewareFunction<T, T>

Type Parameters

optional
T = Query<any, any>

Parameters

method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp
fn: ErrorHandlingMiddlewareFunction<T>

Type Parameters

optional
T = Query<any, any>

Parameters

method: MongooseQueryMiddleware | MongooseQueryMiddleware[] | RegExp
options: SchemaPostOptions
fn: ErrorHandlingMiddlewareFunction<T>

Type Parameters

optional
T = HydratedDocument<DocType, TInstanceMethods>

Parameters

method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp
fn: ErrorHandlingMiddlewareFunction<T>

Type Parameters

optional
T = HydratedDocument<DocType, TInstanceMethods>

Parameters

method: MongooseDocumentMiddleware | MongooseDocumentMiddleware[] | RegExp
options: SchemaPostOptions
fn: ErrorHandlingMiddlewareFunction<T>

Type Parameters

T extends Aggregate<any>

Parameters

method: "aggregate" | RegExp
fn: ErrorHandlingMiddlewareFunction<T, Array<any>>

Type Parameters

T extends Aggregate<any>

Parameters

method: "aggregate" | RegExp
options: SchemaPostOptions
fn: ErrorHandlingMiddlewareFunction<T, Array<any>>

Type Parameters

optional
T = M

Parameters

method: "insertMany" | RegExp
fn: ErrorHandlingMiddlewareFunction<T>

Type Parameters

optional
T = M

Parameters

method: "insertMany" | RegExp
options: SchemaPostOptions
fn: ErrorHandlingMiddlewareFunction<T>