Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "middleware"

Index

Type aliases

ActionType

AggregateHookFunction

AggregateHookFunction<T>: (this: Aggregate<T>, error?: Error, doc?: Aggregate<T>, next?: Fn) => R<unknown>

Type parameters

  • T

Type declaration

    • (this: Aggregate<T>, error?: Error, doc?: Aggregate<T>, next?: Fn): R<unknown>
    • Parameters

      • this: Aggregate<T>
      • Optional error: Error
      • Optional doc: Aggregate<T>
      • Optional next: Fn

      Returns R<unknown>

AggregateMiddlewareType

AggregateMiddlewareType: "aggregate"

DocumentHookFunction

DocumentHookFunction<T>: (this: DocumentType<T>, error?: Error, doc?: DocumentType<T>, next?: Fn) => R<unknown>

Type parameters

  • T

Type declaration

DocumentMiddlewareType

DocumentMiddlewareType: "validate" | "save" | "remove" | "init"

HookFunction

HookFunction<T>: T extends Document ? ModelHookFunction<T> | QueryHookFunction<T> : DocumentHookFunction<T> | AggregateHookFunction<T>

Type parameters

  • T

HookType

HookType: "pre" | "post"

ModelHookFunction

ModelHookFunction<T>: (this: Model<T>, error?: Error, doc?: Model<T>, next?: Fn) => R<unknown>

Type parameters

  • T: Document

Type declaration

    • (this: Model<T>, error?: Error, doc?: Model<T>, next?: Fn): R<unknown>
    • Parameters

      • this: Model<T>
      • Optional error: Error
      • Optional doc: Model<T>
      • Optional next: Fn

      Returns R<unknown>

ModelMiddlewareType

ModelMiddlewareType: "insertMany"

QueryHookFunction

QueryHookFunction<T>: (this: Query<T, T>, error?: Error, doc?: Query<T, T>, next?: Fn) => R<unknown>

Type parameters

  • T: Document

Type declaration

    • (this: Query<T, T>, error?: Error, doc?: Query<T, T>, next?: Fn): R<unknown>
    • Parameters

      • this: Query<T, T>
      • Optional error: Error
      • Optional doc: Query<T, T>
      • Optional next: Fn

      Returns R<unknown>

QueryMiddlewareType

QueryMiddlewareType: "count" | "find" | "findOne" | "findOneAndRemove" | "findOneAndUpdate" | "update" | "updateOne" | "updateMany"

R

R<T>: T | Promise<T>

Type parameters

  • T

Functions

middleware

Generated using TypeDoc