Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace <internal>

Index

Interfaces

Variables

Namespaces

Classes BSONType

Classes Error

Classes Event

Classes Other

Type Aliases

Enumerations

Variables

LongWithoutOverridesClass: LongWithoutOverrides
AuthMechanism: Readonly<{ MONGODB_AWS: "MONGODB-AWS"; MONGODB_CR: "MONGODB-CR"; MONGODB_DEFAULT: "DEFAULT"; MONGODB_GSSAPI: "GSSAPI"; MONGODB_PLAIN: "PLAIN"; MONGODB_SCRAM_SHA1: "SCRAM-SHA-1"; MONGODB_SCRAM_SHA256: "SCRAM-SHA-256"; MONGODB_X509: "MONGODB-X509" }>
AutoEncryptionLoggerLevel: Readonly<{ FatalError: 0; Error: 1; Warning: 2; Info: 3; Trace: 4 }>
BatchType: Readonly<{ INSERT: 1; UPDATE: 2; DELETE: 3 }>
BSONType: Readonly<{ double: 1; string: 2; object: 3; array: 4; binData: 5; undefined: 6; objectId: 7; bool: 8; date: 9; null: 10; regex: 11; dbPointer: 12; javascript: 13; symbol: 14; javascriptWithScope: 15; int: 16; timestamp: 17; long: 18; decimal: 19; minKey: -1; maxKey: 127 }>
ExplainVerbosity: Readonly<{ queryPlanner: "queryPlanner"; queryPlannerExtended: "queryPlannerExtended"; executionStats: "executionStats"; allPlansExecution: "allPlansExecution" }>
GSSAPICanonicalizationValue: Readonly<{ on: true; off: false; none: "none"; forward: "forward"; forwardAndReverse: "forwardAndReverse" }>
LEGAL_TCP_SOCKET_OPTIONS: readonly ["family", "hints", "localAddress", "localPort", "lookup"]
LEGAL_TLS_SOCKET_OPTIONS: readonly ["ALPNProtocols", "ca", "cert", "checkServerIdentity", "ciphers", "crl", "ecdhCurve", "key", "minDHSize", "passphrase", "pfx", "rejectUnauthorized", "secureContext", "secureProtocol", "servername", "session"]
LoggerLevel: Readonly<{ ERROR: "error"; WARN: "warn"; INFO: "info"; DEBUG: "debug"; error: "error"; warn: "warn"; info: "info"; debug: "debug" }>
MONGO_CLIENT_EVENTS: readonly ["connectionPoolCreated", "connectionPoolReady", "connectionPoolCleared", "connectionPoolClosed", "connectionCreated", "connectionReady", "connectionClosed", "connectionCheckOutStarted", "connectionCheckOutFailed", "connectionCheckedOut", "connectionCheckedIn", "commandStarted", "commandSucceeded", "commandFailed", "serverOpening", "serverClosed", "serverDescriptionChanged", "topologyOpening", "topologyClosed", "topologyDescriptionChanged", "error", "timeout", "close", "serverHeartbeatStarted", "serverHeartbeatSucceeded", "serverHeartbeatFailed"]
ProfilingLevel: Readonly<{ off: "off"; slowOnly: "slow_only"; all: "all" }>
ReadConcernLevel: Readonly<{ local: "local"; majority: "majority"; linearizable: "linearizable"; available: "available"; snapshot: "snapshot" }>
ReadPreferenceMode: Readonly<{ primary: "primary"; primaryPreferred: "primaryPreferred"; secondary: "secondary"; secondaryPreferred: "secondaryPreferred"; nearest: "nearest" }>
ReturnDocument: Readonly<{ BEFORE: "before"; AFTER: "after" }>
ServerType: Readonly<{ Standalone: "Standalone"; Mongos: "Mongos"; PossiblePrimary: "PossiblePrimary"; RSPrimary: "RSPrimary"; RSSecondary: "RSSecondary"; RSArbiter: "RSArbiter"; RSOther: "RSOther"; RSGhost: "RSGhost"; Unknown: "Unknown"; LoadBalancer: "LoadBalancer" }>

An enumeration of server types we know about

TopologyType: Readonly<{ Single: "Single"; ReplicaSetNoPrimary: "ReplicaSetNoPrimary"; ReplicaSetWithPrimary: "ReplicaSetWithPrimary"; Sharded: "Sharded"; Unknown: "Unknown"; LoadBalanced: "LoadBalanced" }>

An enumeration of topology types we know about

Model: <internal>.Model<any>
Locale: (new (tag: string | <internal>.Locale, options?: LocaleOptions) => <internal>.Locale)

Type declaration

Object: ObjectConstructor

Provides functionality common to all JavaScript objects.

Number: NumberConstructor

An object that represents a number of any kind. All JavaScript numbers are 64-bit floating-point numbers.

Type Aliases

_Command: typeof <internal>.Command
BooleanResponse: 1 | 0
Callback<T>: ((err: Error | null, res: T) => void)

Type Parameters

  • T

Type declaration

    • (err: Error | null, res: T): void
    • Parameters

      • err: Error | null
      • res: T

      Returns void

KeyType: string | <internal>.Buffer
ValueType: string | <internal>.Buffer | number | any[]
BufferEncoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex"
Platform: "aix" | "android" | "darwin" | "freebsd" | "linux" | "openbsd" | "sunos" | "win32" | "cygwin" | "netbsd"
TypedArray: Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | <internal>.BigUint64Array | <internal>.BigInt64Array | Float32Array | Float64Array
ArrayBufferView: <internal>.TypedArray | DataView
LookupFunction: ((hostname: string, options: <internal>.LookupOneOptions, callback: ((err: <internal>.ErrnoException | null, address: string, family: number) => void)) => void)

Type declaration

SocketReadyState: "opening" | "open" | "readOnly" | "writeOnly" | "closed"
SecureVersion: "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1"
BinarySequence: Uint8Array | <internal>.Buffer | number[]
LongWithoutOverrides: (new (low: unknown, high?: number, unsigned?: boolean) => { [ P in <internal>.Exclude<keyof Long, TimestampOverrides>]: Long[P] })

Type declaration

TimestampOverrides: "_bsontype" | "toExtendedJSON" | "fromExtendedJSON" | "inspect"
AbstractCursorEvents: { close: any }

Type declaration

  • close:function
    • close(): void
    • Returns void

AcceptedFields<TSchema, FieldType, AssignableType>: { readonly [ key in KeysOfAType<TSchema, FieldType>]?: AssignableType }

Type Parameters

  • TSchema

  • FieldType

  • AssignableType

AddToSetOperators<Type>: { $each?: Flatten<Type>[] }

Type Parameters

  • Type

Type declaration

AlternativeType<T>: T extends ReadonlyArray<infer U> ? T | RegExpOrString<U> : RegExpOrString<T>

It is possible to search using alternative types in mongodb e.g. string types can be searched using a regex in mongo array types can be searched using their element type

Type Parameters

  • T

AnyBulkWriteOperation<TSchema>: { insertOne: InsertOneModel<TSchema> } | { replaceOne: ReplaceOneModel<TSchema> } | { updateOne: UpdateOneModel<TSchema> } | { updateMany: UpdateManyModel<TSchema> } | { deleteOne: DeleteOneModel<TSchema> } | { deleteMany: DeleteManyModel<TSchema> }

Type Parameters

AnyError: MongoError | Error
ArrayElement<Type>: Type extends ReadonlyArray<infer Item> ? Item : never

Type Parameters

  • Type

ArrayOperator<Type>: { $each?: Flatten<Type>[]; $slice?: number; $position?: number; $sort?: <internal>.Sort }

Type Parameters

  • Type

Type declaration

  • Optional $each?: Flatten<Type>[]
  • Optional $slice?: number
  • Optional $position?: number
  • Optional $sort?: <internal>.Sort
AuthMechanism: typeof <internal>.AuthMechanism[keyof typeof <internal>.AuthMechanism]
AutoEncryptionLoggerLevel: typeof <internal>.AutoEncryptionLoggerLevel[keyof typeof <internal>.AutoEncryptionLoggerLevel]
BatchType: typeof <internal>.BatchType[keyof typeof <internal>.BatchType]
BitwiseFilter: number | Binary | ReadonlyArray<number>
BSONType: typeof <internal>.BSONType[keyof typeof <internal>.BSONType]
Callback<T>: ((error?: AnyError, result?: T) => void)

Type Parameters

  • T = any

Type declaration

    • MongoDB Driver style callback

      Parameters

      • Optional error: AnyError
      • Optional result: T

      Returns void

Type Parameters

ChangeStreamEvents<TSchema, TChange>: { resumeTokenChanged: any; init: any; more: any; response: any; end: any; error: any; change: any } & AbstractCursorEvents

Type Parameters

ClientSessionEvents: { ended: any }

Type declaration

  • ended:function
    • Parameters

      Returns void

CommonEvents: "newListener" | "removeListener"

Type Parameters

  • T

ConnectionEvents: { commandStarted: any; commandSucceeded: any; commandFailed: any; clusterTimeReceived: any; close: any; message: any; pinned: any; unpinned: any }

Type declaration

  • commandStarted:function
    • Parameters

      Returns void

  • commandSucceeded:function
  • commandFailed:function
    • Parameters

      Returns void

  • clusterTimeReceived:function
    • Parameters

      Returns void

  • close:function
    • close(): void
    • Returns void

  • message:function
    • message(message: any): void
    • Parameters

      • message: any

      Returns void

  • pinned:function
    • pinned(pinType: string): void
    • Parameters

      • pinType: string

      Returns void

  • unpinned:function
    • unpinned(pinType: string): void
    • Parameters

      • pinType: string

      Returns void

ConnectionPoolEvents: { connectionPoolCreated: any; connectionPoolReady: any; connectionPoolClosed: any; connectionPoolCleared: any; connectionCreated: any; connectionReady: any; connectionClosed: any; connectionCheckOutStarted: any; connectionCheckOutFailed: any; connectionCheckedOut: any; connectionCheckedIn: any } & <internal>.Omit<ConnectionEvents, "close" | "message">
EnhancedOmit<TRecordOrUnion, KeyUnion>: string extends keyof TRecordOrUnion ? TRecordOrUnion : TRecordOrUnion extends any ? <internal>.Pick<TRecordOrUnion, <internal>.Exclude<keyof TRecordOrUnion, KeyUnion>> : never

TypeScript Omit (Exclude to be specific) does not work for objects with an "any" indexed type, and breaks discriminated unions @public

Type Parameters

  • TRecordOrUnion

  • KeyUnion

EventEmitterWithState: {}

Type declaration

    EventsDescription: <internal>.Record<string, GenericListener>

    Event description type

    ExplainVerbosity: string
    ExplainVerbosityLike: <internal>.ExplainVerbosity | boolean

    For backwards compatibility, true is interpreted as "allPlansExecution" and false as "queryPlanner". Prior to server version 3.6, aggregate() ignores the verbosity parameter and executes in "queryPlanner".

    Filter<TSchema>: Partial<TSchema> | { [ Property in Join<NestedPaths<WithId<TSchema>, []>, ".">]?: <internal>.Condition<PropertyType<WithId<TSchema>, Property>> } & RootFilterOperators<WithId<TSchema>>

    A MongoDB filter can be some portion of the schema or a set of operators @public

    Type Parameters

    • TSchema

    FilterOperations<T>: T extends <internal>.Record<string, any> ? { [ key in keyof T]?: FilterOperators<T[key]> } : FilterOperators<T>

    Type Parameters

    • T

    FinalizeFunction<TKey, TValue>: ((key: TKey, reducedValue: TValue) => TValue)

    Type Parameters

    Type declaration

      • (key: TKey, reducedValue: TValue): TValue
      • Parameters

        • key: TKey
        • reducedValue: TValue

        Returns TValue

    Flatten<Type>: Type extends ReadonlyArray<infer Item> ? Item : Type

    Type Parameters

    • Type

    GenericListener: ((...args: any[]) => void)

    Type declaration

      • (...args: any[]): void
      • Parameters

        • Rest ...args: any[]

        Returns void

    GSSAPICanonicalizationValue: typeof <internal>.GSSAPICanonicalizationValue[keyof typeof <internal>.GSSAPICanonicalizationValue]
    Hint: string | <internal>.Document
    IndexDirection: -1 | 1 | "2d" | "2dsphere" | "text" | "geoHaystack" | "hashed" | number
    IndexSpecification: OneOrMore<string | [string, <internal>.IndexDirection] | {} | Map<string, <internal>.IndexDirection>>
    InferIdType<TSchema>: TSchema extends { _id: infer IdType } ? <internal>.Record<any, never> extends IdType ? never : IdType : TSchema extends { _id?: infer IdType } ? unknown extends IdType ? <internal>.ObjectId : IdType : <internal>.ObjectId

    Given an object shaped type, return the type of the _id field or default to ObjectId @public

    Type Parameters

    • TSchema

    IntegerType: number | Int32 | Long
    IsAny<Type, ResultIfAny, ResultIfNotAny>: true extends false & Type ? ResultIfAny : ResultIfNotAny

    Type Parameters

    • Type

    • ResultIfAny

    • ResultIfNotAny

    Join<T, D>: T extends [] ? "" : T extends [string | number] ? `${T[0]}` : T extends [string | number, ...(infer R)] ? `${T[0]}${D}${Join<R, D>}` : string

    Type Parameters

    • T extends unknown[]

    • D extends string

    KeysOfAType<TSchema, Type>: { [ key in keyof TSchema]: NonNullable<TSchema[key]> extends Type ? key : never }[keyof TSchema]

    Type Parameters

    • TSchema

    • Type

    KeysOfOtherType<TSchema, Type>: { [ key in keyof TSchema]: NonNullable<TSchema[key]> extends Type ? never : key }[keyof TSchema]

    Type Parameters

    • TSchema

    • Type

    LoggerFunction: ((message?: any, ...optionalParams: any[]) => void)

    Type declaration

      • (message?: any, ...optionalParams: any[]): void
      • Parameters

        • Optional message: any
        • Rest ...optionalParams: any[]

        Returns void

    LoggerLevel: typeof <internal>.LoggerLevel[keyof typeof <internal>.LoggerLevel]
    MapFunction<TSchema>: ((this: TSchema) => void)

    Type Parameters

    Type declaration

      • (this: TSchema): void
      • Parameters

        • this: TSchema

        Returns void

    MatchKeysAndValues<TSchema>: Readonly<{ [ Property in Join<NestedPaths<TSchema, []>, ".">]?: PropertyType<TSchema, Property> } & { [ Property in `${NestedPathsOfType<TSchema, any[]>}.$${`[${string}]` | ""}`]?: ArrayElement<PropertyType<TSchema, Property extends `${infer Key}.$${string}` ? Key : never>> } & { [ Property in `${NestedPathsOfType<TSchema, <internal>.Record<string, any>[]>}.$${`[${string}]` | ""}.${string}`]?: any } & <internal>.Document>

    Type Parameters

    • TSchema

    MongoClientEvents: <internal>.Pick<TopologyEvents, typeof MONGO_CLIENT_EVENTS[number]> & { open: any }
    NestedPaths<Type, Depth>: Depth["length"] extends 8 ? [] : Type extends string | number | boolean | Date | RegExp | <internal>.Buffer | Uint8Array | ((...args: any[]) => any) | { _bsontype: string } ? [] : Type extends ReadonlyArray<infer ArrayType> ? [] | [number, ...NestedPaths<ArrayType, [...Depth, 1]>] : Type extends Map<string, any> ? [string] : Type extends object ? { [ Key in Extract<keyof Type, string>]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray<infer ArrayType> ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [Key, ...NestedPaths<Type[Key], [...Depth, 1]>] : [Key, ...NestedPaths<Type[Key], [...Depth, 1]>] | [Key] }[Extract<keyof Type, string>] : []
    remarks

    Through testing we determined that a depth of 8 is safe for the typescript compiler and provides reasonable compilation times. This number is otherwise not special and should be changed if issues are found with this level of checking. Beyond this depth any helpers that make use of NestedPaths should devolve to not asserting any type safety on the input.

    Type Parameters

    • Type

    • Depth extends number[]

    NestedPathsOfType<TSchema, Type>: KeysOfAType<{ [ Property in Join<NestedPaths<TSchema, []>, ".">]: PropertyType<TSchema, Property> }, Type>

    Type Parameters

    • TSchema

    • Type

    NonObjectIdLikeDocument: { [ key in keyof ObjectIdLike]?: never } & <internal>.Document
    NotAcceptedFields<TSchema, FieldType>: { readonly [ key in KeysOfOtherType<TSchema, FieldType>]?: never }

    It avoids using fields with not acceptable types @public

    Type Parameters

    • TSchema

    • FieldType

    OneOrMore<T>: T | ReadonlyArray<T>

    Type Parameters

    • T

    OnlyFieldsOfType<TSchema, FieldType, AssignableType>: IsAny<TSchema[keyof TSchema], <internal>.Record<string, FieldType>, AcceptedFields<TSchema, FieldType, AssignableType> & NotAcceptedFields<TSchema, FieldType> & <internal>.Record<string, AssignableType>>

    Type Parameters

    • TSchema

    • FieldType = any

    • AssignableType = FieldType

    OptionalId<TSchema>: EnhancedOmit<TSchema, "_id"> & { _id?: InferIdType<TSchema> }

    Add an optional _id field to an object shaped type

    Type Parameters

    • TSchema

    OptionalUnlessRequiredId<TSchema>: TSchema extends { _id: any } ? TSchema : OptionalId<TSchema>

    Adds an optional _id field to an object shaped type, unless the _id field is required on that type. In the case _id is required, this method continues to require_id.

    privateremarks

    ObjectId extends TSchema['_id'] is a confusing ordering at first glance. Rather than ask TSchema['_id'] extends ObjectId which translated to "Is the _id property ObjectId?" we instead ask "Does ObjectId look like (have the same shape) as the _id?"

    Type Parameters

    • TSchema

    ProfilingLevel: typeof <internal>.ProfilingLevel[keyof typeof <internal>.ProfilingLevel]
    PropertyType<Type, Property>: string extends Property ? unknown : Property extends keyof Type ? Type[Property] : Property extends `${number}` ? Type extends ReadonlyArray<infer ArrayType> ? ArrayType : unknown : Property extends `${infer Key}.${infer Rest}` ? Key extends `${number}` ? Type extends ReadonlyArray<infer ArrayType> ? PropertyType<ArrayType, Rest> : unknown : Key extends keyof Type ? Type[Key] extends Map<string, infer MapType> ? MapType : PropertyType<Type[Key], Rest> : unknown : unknown

    Type Parameters

    • Type

    • Property extends string

    PullAllOperator<TSchema>: { readonly [ key in KeysOfAType<TSchema, ReadonlyArray<any>>]?: TSchema[key] } & NotAcceptedFields<TSchema, ReadonlyArray<any>> & {}

    Type Parameters

    • TSchema

    PullOperator<TSchema>: { readonly [ key in KeysOfAType<TSchema, ReadonlyArray<any>>]?: Partial<Flatten<TSchema[key]>> | FilterOperations<Flatten<TSchema[key]>> } & NotAcceptedFields<TSchema, ReadonlyArray<any>> & {}

    Type Parameters

    • TSchema

    PushOperator<TSchema>: { readonly [ key in KeysOfAType<TSchema, ReadonlyArray<any>>]?: Flatten<TSchema[key]> | ArrayOperator<Flatten<TSchema[key]>[]> } & NotAcceptedFields<TSchema, ReadonlyArray<any>> & {}

    Type Parameters

    • TSchema

    ReadConcernLevel: typeof <internal>.ReadConcernLevel[keyof typeof <internal>.ReadConcernLevel]
    ReadPreferenceMode: typeof <internal>.ReadPreferenceMode[keyof typeof <internal>.ReadPreferenceMode]
    ReduceFunction<TKey, TValue>: ((key: TKey, values: TValue[]) => TValue)

    Type Parameters

    Type declaration

      • (key: TKey, values: TValue[]): TValue
      • Parameters

        • key: TKey
        • values: TValue[]

        Returns TValue

    RegExpOrString<T>: T extends string ? BSONRegExp | RegExp | T : T

    Type Parameters

    • T

    ReturnDocument: typeof <internal>.ReturnDocument[keyof typeof <internal>.ReturnDocument]
    ServerEvents: { serverHeartbeatStarted: any; serverHeartbeatSucceeded: any; serverHeartbeatFailed: any; descriptionReceived: any; closed: any; ended: any } & ConnectionPoolEvents & EventEmitterWithState
    ServerSessionId: { id: Binary }

    Type declaration

    ServerType: typeof <internal>.ServerType[keyof typeof <internal>.ServerType]
    SetFields<TSchema>: { readonly [ key in KeysOfAType<TSchema, ReadonlyArray<any> | undefined>]?: OptionalId<Flatten<TSchema[key]>> | AddToSetOperators<OptionalId<Flatten<TSchema[key]>>[]> } & NotAcceptedFields<TSchema, ReadonlyArray<any> | undefined> & {}

    Type Parameters

    • TSchema

    Sort: string | <internal>.Exclude<SortDirection, { $meta: string }> | string[] | {} | Map<string, SortDirection> | [string, SortDirection][] | [string, SortDirection]
    SortDirection: 1 | -1 | "asc" | "desc" | "ascending" | "descending" | { $meta: string }
    SupportedSocketOptions: <internal>.Pick<TcpNetConnectOpts, typeof LEGAL_TCP_SOCKET_OPTIONS[number]>
    SupportedTLSSocketOptions: <internal>.Pick<TLSSocketOptions, Extract<keyof TLSSocketOptions, typeof LEGAL_TLS_SOCKET_OPTIONS[number]>>
    TagSet: {}

    Type declaration

    • [key: string]: string
    TopologyEvents: { serverOpening: any; serverClosed: any; serverDescriptionChanged: any; topologyClosed: any; topologyOpening: any; topologyDescriptionChanged: any; error: any; close: any; timeout: any } & <internal>.Omit<ServerEvents, "connect"> & ConnectionPoolEvents & ConnectionEvents & EventEmitterWithState
    TopologyType: typeof <internal>.TopologyType[keyof typeof <internal>.TopologyType]
    UpdateFilter<TSchema>: { $currentDate?: OnlyFieldsOfType<TSchema, Date | Timestamp, true | { $type: "date" | "timestamp" }>; $inc?: OnlyFieldsOfType<TSchema, NumericType | undefined>; $min?: MatchKeysAndValues<TSchema>; $max?: MatchKeysAndValues<TSchema>; $mul?: OnlyFieldsOfType<TSchema, NumericType | undefined>; $rename?: <internal>.Record<string, string>; $set?: MatchKeysAndValues<TSchema>; $setOnInsert?: MatchKeysAndValues<TSchema>; $unset?: OnlyFieldsOfType<TSchema, any, "" | true | 1>; $addToSet?: SetFields<TSchema>; $pop?: OnlyFieldsOfType<TSchema, ReadonlyArray<any>, 1 | -1>; $pull?: PullOperator<TSchema>; $push?: PushOperator<TSchema>; $pullAll?: PullAllOperator<TSchema>; $bit?: OnlyFieldsOfType<TSchema, NumericType | undefined, { and: IntegerType } | { or: IntegerType } | { xor: IntegerType }> } & <internal>.Document

    Type Parameters

    • TSchema

    W: number | "majority"
    WithId<TSchema>: EnhancedOmit<TSchema, "_id"> & { _id: InferIdType<TSchema> }

    Add an _id field to an object shaped type @public

    Type Parameters

    • TSchema

    WithoutId<TSchema>: <internal>.Omit<TSchema, "_id">

    Remove the _id field from an object shaped type @public

    Type Parameters

    • TSchema

    WithSessionCallback: ((session: ClientSession) => Promise<any>)

    Type declaration

    WithTransactionCallback<T>: ((session: ClientSession) => Promise<T>)

    Type Parameters

    • T = void

    Type declaration

    CallbackError: NativeError | null
    Callback<T>: ((error: CallbackError, result: T) => void)

    Type Parameters

    • T = any

    Type declaration

    CallbackWithoutResult: ((error: CallbackError) => void)

    Type declaration

    CursorFlag: "tailable" | "oplogReplay" | "noCursorTimeout" | "awaitData" | "partial"
    pathsToSkip: string[] | string

    A list of paths to skip. If set, Mongoose will validate every modified path that is not in this list.

    Path: string
    CodeExpression: string | Function
    BinaryExpression: Path
    FunctionExpression: Function

    Type Parameters

    • T = any

    Type Parameters

    • T = string

    ArithmeticExpressionOperator: Abs | Add | Ceil | Divide | Exp | Floor | Ln | Log | Log10 | Mod | Multiply | Pow | Round | Sqrt | Subtract | Trunc
    LiteralExpressionOperator: Literal
    LiteralExpressionReturningAny: LiteralExpressionOperatorReturningAny
    LiteralExpressionOperatorReturningAny: Literal
    MiscellaneousExpressionOperator: Rand | SampleRate
    MiscellaneousExpressionOperatorReturningNumber: Rand
    ArrayExpressionOperatorReturningAny: ArrayElemAt | <internal>.Expression.First | <internal>.Expression.Last | Reduce
    ArrayExpressionOperatorReturningArray: ConcatArrays | <internal>.Expression.Filter | Map | ObjectToArray | Range | ReverseArray | Slice | Zip
    ArrayExpressionOperatorReturningNumber: IndexOfArray | Size
    ArrayExpressionOperatorReturningObject: ArrayToObject
    ArrayExpressionOperatorReturningBoolean: In | IsArray
    BooleanExpressionOperator: And | Or | Not
    ComparisonExpressionOperatorReturningBoolean: Eq | Gt | Gte | Lt | Lte | Ne
    ComparisonExpressionOperatorReturningNumber: Cmp
    ConditionalExpressionOperator: Cond | IfNull | Switch
    StringExpressionOperatorReturningArray: RegexFindAll | Split
    StringExpressionOperatorReturningBoolean: RegexMatch
    StringExpressionOperatorReturningNumber: IndexOfBytes | IndexOfCP | Strcasecmp | StrLenBytes | StrLenCP
    StringExpressionOperatorReturningObject: RegexFind
    StringExpressionOperatorReturningString: Concat | Ltrim | Ltrim | ReplaceOne | ReplaceAll | Substr | SubstrBytes | SubstrCP | ToLower | ToString | ToUpper | Trim
    ObjectExpressionOperator: MergeObjects | ObjectToArray | SetField | UnsetField
    ObjectExpressionOperatorReturningArray: ObjectToArray
    ObjectExpressionOperatorReturningObject: MergeObjects | SetField | UnsetField
    VariableExpressionOperator: Let
    SetExpressionOperatorReturningBoolean: AllElementsTrue | AnyElementsTrue | SetEquals | SetIsSubset
    SetExpressionOperatorReturningArray: SetDifference | SetIntersection | SetUnion
    TrigonometryExpressionOperator: Sin | Cos | Tan | Asin | Acos | Atan | Atan2 | Asinh | Acosh | Atanh | Sinh | Cosh | Tanh | DegreesToRadians | RadiansToDegrees

    Trigonometry expressions perform trigonometric operations on numbers. Values that represent angles are always input or output in radians. Use $degreesToRadians and $radiansToDegrees to convert between degree and radian measurements.

    TextExpressionOperator: <internal>.Meta
    WindowOperatorReturningArray: <internal>.Expression.AddToSet | <internal>.Expression.Push
    TypeExpressionOperator: Convert | IsNumber | ToBool | ToDate | ToDecimal | ToDouble | ToInt | ToLong | ToObjectId | ToString | Type
    TypeExpressionOperatorReturningNumber: Convert<"double" | 1 | "int" | 16 | "long" | 18 | "decimal" | 19> | ToDecimal | ToDouble | ToInt | ToLong
    TypeExpressionOperatorReturningBoolean: Convert<"bool" | 8> | IsNumber | ToBool
    TypeExpressionOperatorReturningString: Convert<"string" | 2> | ToString | Type
    TypeExpressionOperatorReturningObjectId: Convert<"objectId" | 7> | ToObjectId
    TypeExpressionOperatorReturningDate: Convert<"date" | 9> | ToDate
    DataSizeOperator: BinarySize | BsonSize
    DataSizeOperatorReturningNumber: BinarySize | BsonSize
    CustomAggregationExpressionOperator: Accumulator | Function
    CustomAggregationExpressionOperatorReturningAny: Function
    hh: "-00" | "-01" | "-02" | "-03" | "-04" | "-05" | "-06" | "-07" | "-08" | "-09" | "-10" | "-11" | "-12" | "+00" | "+01" | "+02" | "+03" | "+04" | "+05" | "+06" | "+07" | "+08" | "+09" | "+10" | "+11" | "+12" | "+13" | "+14"
    mm: "00" | "30" | "45"
    UTCOffset: `${hh}` | `${hh}${mm}` | `${hh}:${mm}`
    RegexOptions: "i" | "m" | "s" | "x" | "is" | "im" | "ix" | "si" | "sm" | "sx" | "mi" | "ms" | "mx" | "xi" | "xs" | "xm" | "ism" | "isx" | "ims" | "imx" | "ixs" | "ixm" | "sim" | "six" | "smi" | "smx" | "sxi" | "sxm" | "mis" | "mix" | "msi" | "msx" | "mxi" | "mxs" | "xis" | "xim" | "xsi" | "xsm" | "xmi" | "xms" | "ismx" | "isxm" | "imsx" | "imxs" | "ixsm" | "ixms" | "simx" | "sixm" | "smix" | "smxi" | "sxim" | "sxmi" | "misx" | "mixs" | "msix" | "msxi" | "mxis" | "mxsi" | "xism" | "xims" | "xsim" | "xsmi" | "xmis" | "xmsi"
    StartOfWeek: "monday" | "mon" | "tuesday" | "tue" | "wednesday" | "wed" | "thursday" | "thu" | "friday" | "fri" | "saturday" | "sat" | "sunday" | "sun"
    DateUnit: "year" | "quarter" | "week" | "month" | "day" | "hour" | "minute" | "second" | "millisecond"
    DateExpressionOperatorReturningObject: DateToParts
    DateExpressionOperatorReturningNumber: DateDiff | DayOfMonth | DayOfWeek | DayOfYear | IsoDayOfWeek | IsoWeek | IsoWeekYear | Millisecond | Second | Minute | Hour | Month | Year
    DateExpressionOperatorReturningDate: DateAdd | DateFromParts | DateFromString | DateSubtract | DateTrunc | ToDate
    DateExpressionOperatorReturningString: DateToString
    CompileModelOptions: { overwriteModels?: boolean; connection?: <internal>.Connection }

    Type declaration

    AnyKeys<T>: { [ P in keyof T]?: T[P] | any }

    Type Parameters

    • T

    Require_id<T>: T extends { _id?: infer U } ? IfAny<U, T & { _id: <internal>.ObjectId }, T & Required<{ _id: U }>> : T & { _id: <internal>.ObjectId }

    Type Parameters

    • T

    HydratedDocument<DocType, TMethodsAndOverrides, TVirtuals>: DocType extends <internal>.Document ? Require_id<DocType> : <internal>.Document<unknown, any, DocType> & Require_id<DocType> & TVirtuals & TMethodsAndOverrides

    Type Parameters

    • DocType

    • TMethodsAndOverrides = {}

    • TVirtuals = {}

    NumberSchemaDefinition: typeof <internal>.Number | "number" | "Number" | typeof <internal>.Number
    StringSchemaDefinition: typeof String | "string" | "String" | typeof String
    BooleanSchemaDefinition: typeof <internal>.Boolean | "boolean" | "Boolean" | typeof <internal>.Boolean
    DateSchemaDefinition: typeof NativeDate | "date" | "Date" | typeof Date
    ObjectIdSchemaDefinition: "ObjectId" | "ObjectID" | typeof <internal>.ObjectId
    SchemaDefinitionWithBuiltInClass<T>: T extends number ? NumberSchemaDefinition : T extends string ? StringSchemaDefinition : T extends boolean ? BooleanSchemaDefinition : T extends NativeDate ? DateSchemaDefinition : Function | string

    Type Parameters

    • T

    SchemaDefinitionProperty<T>: SchemaDefinitionWithBuiltInClass<T> | SchemaTypeOptions<T extends undefined ? any : T> | typeof SchemaType | Schema<any, any, any> | Schema<any, any, any>[] | SchemaTypeOptions<T extends undefined ? any : Unpacked<T>>[] | Function[] | SchemaDefinition<T> | SchemaDefinition<Unpacked<T>>[] | typeof Mixed | MixedSchemaTypeOptions

    Type Parameters

    • T = undefined

    SchemaDefinition<T>: T extends undefined ? {} : { [ path in keyof T]?: SchemaDefinitionProperty<T[path]> }

    Type Parameters

    • T = undefined

    AnyArray<T>: T[] | ReadonlyArray<T>

    Type Parameters

    • T

    ExtractMongooseArray<T>: T extends Array<any> ? AnyArray<Unpacked<T>> : T

    Type Parameters

    • T

    InferId<T>: T extends { _id?: any } ? T["_id"] : <internal>.ObjectId

    Type Parameters

    • T

    ProjectionElementType: number | string
    ProjectionType<T>: { [ P in keyof T]?: ProjectionElementType } | AnyObject | string

    Type Parameters

    • T

    SortOrder: -1 | 1 | "asc" | "ascending" | "desc" | "descending"
    _UpdateQuery<TSchema>: { $currentDate?: AnyKeys<TSchema> & AnyObject; $inc?: AnyKeys<TSchema> & AnyObject; $min?: AnyKeys<TSchema> & AnyObject; $max?: AnyKeys<TSchema> & AnyObject; $mul?: AnyKeys<TSchema> & AnyObject; $rename?: <internal>.Record<string, string>; $set?: AnyKeys<TSchema> & AnyObject; $setOnInsert?: AnyKeys<TSchema> & AnyObject; $unset?: AnyKeys<TSchema> & AnyObject; $addToSet?: AnyKeys<TSchema> & AnyObject; $pop?: AnyKeys<TSchema> & AnyObject; $pull?: AnyKeys<TSchema> & AnyObject; $push?: AnyKeys<TSchema> & AnyObject; $pullAll?: AnyKeys<TSchema> & AnyObject; $bit?: AnyKeys<TSchema> }

    Type Parameters

    • TSchema

    Type declaration

    UpdateWithAggregationPipeline: UpdateAggregationStage[]
    UpdateAggregationStage: { $addFields: any } | { $set: any } | { $project: any } | { $unset: any } | { $replaceRoot: any } | { $replaceWith: any }
    UpdateQuery<T>: _UpdateQuery<T> & AnyObject

    Update query command to perform on the document

    example
    { age: 30 }
    

    Type Parameters

    • T

    FlattenMaps<T>: { [ K in keyof T]: T[K] extends Map<any, any> ? AnyObject : T[K] extends TreatAsPrimitives ? T[K] : FlattenMaps<T[K]> }

    Type Parameters

    • T

    actualPrimitives: string | boolean | number | bigint | symbol | null | undefined
    TreatAsPrimitives: actualPrimitives | NativeDate | RegExp | symbol | Error | <internal>.BigInt | <internal>.ObjectId
    LeanType<T>: 0 extends 1 & T ? T : T extends TreatAsPrimitives ? T : T extends Subdocument ? <internal>.Omit<LeanDocument<T>, "$isSingleNested" | "ownerDocument" | "parent"> : LeanDocument<T>

    Type Parameters

    • T

    LeanArray<T>: T extends unknown[][] ? LeanArray<T[number]>[] : LeanType<T[number]>[]

    Type Parameters

    • T extends unknown[]

    _LeanDocument<T>: { [ K in keyof T]: LeanDocumentElement<T[K]> }

    Type Parameters

    • T

    LeanDocumentElement<T>: T extends unknown[] ? LeanArray<T> : T extends <internal>.Document ? LeanDocument<T> : T

    Type Parameters

    • T

    LeanDocument<T>: <internal>.Omit<_LeanDocument<T>, <internal>.Exclude<keyof <internal>.Document, "_id" | "id" | "__v"> | "$isSingleNested">

    Documents returned from queries with the lean option enabled. Plain old JavaScript object documents (POJO).

    see

    https://mongoosejs.com/docs/tutorials/lean.html

    Type Parameters

    • T

    LeanDocumentOrArray<T>: 0 extends 1 & T ? T : T extends unknown[] ? LeanDocument<T[number]>[] : T extends <internal>.Document ? LeanDocument<T> : T

    Type Parameters

    • T

    LeanDocumentOrArrayWithRawType<T, RawDocType>: 0 extends 1 & T ? T : T extends unknown[] ? LeanDocument<RawDocType>[] : T extends <internal>.Document ? LeanDocument<RawDocType> : T

    Type Parameters

    • T

    • RawDocType

    IndexDirection: 1 | -1 | "2d" | "2dsphere" | "geoHaystack" | "hashed" | "text" | "ascending" | "asc" | "descending" | "desc"
    ConnectionSyncIndexesResult: <internal>.Record<string, OneCollectionSyncIndexesResult>
    OneCollectionSyncIndexesResult: string[] & MongoServerError
    ObtainDocumentType<DocDefinition, EnforcedDocType, TSchemaOptions>: IsItRecordAndNotAny<EnforcedDocType> extends true ? EnforcedDocType : { [ K in keyof (RequiredPaths<DocDefinition, TSchemaOptions["typeKey"]> & OptionalPaths<DocDefinition, TSchemaOptions["typeKey"]>)]: ObtainDocumentPathType<DocDefinition[K], TSchemaOptions["typeKey"]> }
    summary

    Obtains document schema type.

    description

    Obtains document schema type from document Definition OR returns enforced schema type if it's provided.

    param TypeKey

    A generic of literal string type."Refers to the property used for path type definition".

    Type Parameters

    • DocDefinition

      A generic equals to the type of document definition "provided in as first parameter in Schema constructor".

    • EnforcedDocType = any

      A generic type enforced by user "provided before schema constructor".

    • TSchemaOptions extends <internal>.Record<any, any> = DefaultSchemaOptions

    InferSchemaType<TSchema>: IfAny<TSchema, any, ObtainSchemaGeneric<TSchema, "DocType">>
    summary

    Obtains document schema type from Schema instance.

    example

    const userSchema = new Schema({userName:String}); type UserType = InferSchemaType; // result type UserType = {userName?: string}

    Type Parameters

    • TSchema

      typeof a schema instance.

    ObtainSchemaGeneric<TSchema, alias>: TSchema extends Schema<infer EnforcedDocType, infer M, infer TInstanceMethods, infer TQueryHelpers, infer TVirtuals, infer TStaticMethods, infer TSchemaOptions, infer DocType> ? { EnforcedDocType: EnforcedDocType; M: M; TInstanceMethods: TInstanceMethods; TQueryHelpers: TQueryHelpers; TVirtuals: TVirtuals; TStaticMethods: TStaticMethods; TSchemaOptions: TSchemaOptions; DocType: DocType }[alias] : unknown
    summary

    Obtains schema Generic type by using generic alias.

    Type Parameters

    • TSchema

      A generic of schema type instance.

    • alias extends "EnforcedDocType" | "M" | "TInstanceMethods" | "TQueryHelpers" | "TVirtuals" | "TStaticMethods" | "TSchemaOptions" | "DocType"

      Targeted generic alias.

    IsPathDefaultUndefined<PathType>: PathType extends { default: undefined } ? true : PathType extends { default: any } ? true : false

    Type Parameters

    • PathType

    IsPathRequired<P, TypeKey>: P extends { required: true | [true, string | undefined] } | ArrayConstructor | any[] ? true : P extends { required: boolean } ? P extends { required: false } ? false : true : P extends <internal>.Record<TypeKey, ArrayConstructor | any[]> ? IsPathDefaultUndefined<P> extends true ? false : true : P extends <internal>.Record<TypeKey, any> ? P extends { default: any } ? IfEquals<P["default"], undefined, false, true> : false : false
    summary

    Checks if a document path is required or optional.

    Type Parameters

    • P

      Document path.

    • TypeKey extends string = DefaultTypeKey

      A generic of literal string type."Refers to the property used for path type definition".

    PathWithTypePropertyBaseType<TypeKey>: { [ k in TypeKey]: any }
    summary

    Path base type defined by using TypeKey

    description

    It helps to check if a path is defined by TypeKey OR not.

    Type Parameters

    • TypeKey extends string = DefaultTypeKey

      A literal string refers to path type property key.

    RequiredPathKeys<T, TypeKey>: { [ K in keyof T]: IsPathRequired<T[K], TypeKey> extends true ? IfEquals<T[K], any, never, K> : never }[keyof T]
    summary

    A Utility to obtain schema's required path keys.

    returns

    required paths keys of document definition.

    Type Parameters

    • T

      A generic refers to document definition.

    • TypeKey extends string = DefaultTypeKey

      A generic of literal string type."Refers to the property used for path type definition".

    RequiredPaths<T, TypeKey>: { [ K in RequiredPathKeys<T, TypeKey>]: T[K] }
    summary

    A Utility to obtain schema's required paths.

    returns

    a record contains required paths with the corresponding type.

    Type Parameters

    • T

      A generic refers to document definition.

    • TypeKey extends string = DefaultTypeKey

      A generic of literal string type."Refers to the property used for path type definition".

    OptionalPathKeys<T, TypeKey>: { [ K in keyof T]: IsPathRequired<T[K], TypeKey> extends true ? never : K }[keyof T]
    summary

    A Utility to obtain schema's optional path keys.

    returns

    optional paths keys of document definition.

    Type Parameters

    • T

      A generic refers to document definition.

    • TypeKey extends string = DefaultTypeKey

      A generic of literal string type."Refers to the property used for path type definition".

    OptionalPaths<T, TypeKey>: { [ K in OptionalPathKeys<T, TypeKey>]?: T[K] }
    summary

    A Utility to obtain schema's optional paths.

    returns

    a record contains optional paths with the corresponding type.

    Type Parameters

    • T

      A generic refers to document definition.

    • TypeKey extends string = DefaultTypeKey

      A generic of literal string type."Refers to the property used for path type definition".

    ObtainDocumentPathType<PathValueType, TypeKey>: PathValueType extends Schema<any> ? InferSchemaType<PathValueType> : ResolvePathType<PathValueType extends PathWithTypePropertyBaseType<TypeKey> ? PathValueType[TypeKey] : PathValueType, PathValueType extends PathWithTypePropertyBaseType<TypeKey> ? <internal>.Omit<PathValueType, TypeKey> : {}, TypeKey>
    summary

    Obtains schema Path type.

    description

    Obtains Path type by calling ResolvePathType OR by calling InferSchemaType if path of schema type.

    Type Parameters

    • PathValueType

      Document definition path type.

    • TypeKey extends string = DefaultTypeKey

      A generic refers to document definition.

    PathEnumOrString<T>: T extends (infer E)[] ? E : T extends { values: any } ? PathEnumOrString<T["values"]> : string
    returns

    Path enum values type as literal strings or string.

    Type Parameters

    ResolvePathType<PathValueType, Options, TypeKey>: PathValueType extends Schema ? InferSchemaType<PathValueType> : PathValueType extends (infer Item)[] ? IfEquals<Item, never, any[], Item extends Schema ? DocumentArray<ObtainDocumentPathType<Item, TypeKey>> : ObtainDocumentPathType<Item, TypeKey>[]> : PathValueType extends ReadonlyArray<infer Item> ? IfEquals<Item, never, any[], Item extends Schema ? DocumentArray<ObtainDocumentPathType<Item, TypeKey>> : ObtainDocumentPathType<Item, TypeKey>[]> : PathValueType extends StringSchemaDefinition ? PathEnumOrString<Options["enum"]> : IfEquals<PathValueType, String> extends true ? PathEnumOrString<Options["enum"]> : IfEquals<PathValueType, String> extends true ? PathEnumOrString<Options["enum"]> : PathValueType extends NumberSchemaDefinition ? Options["enum"] extends ReadonlyArray<any> ? Options["enum"][number] : number : IfEquals<PathValueType, <internal>.Number> extends true ? number : PathValueType extends DateSchemaDefinition ? Date : IfEquals<PathValueType, Date> extends true ? Date : PathValueType extends typeof <internal>.Buffer | "buffer" | "Buffer" | typeof <internal>.Buffer ? <internal>.Buffer : PathValueType extends BooleanSchemaDefinition ? boolean : IfEquals<PathValueType, <internal>.Boolean> extends true ? boolean : PathValueType extends ObjectIdSchemaDefinition ? <internal>.ObjectId : IfEquals<PathValueType, <internal>.ObjectId> extends true ? <internal>.ObjectId : IfEquals<PathValueType, <internal>.ObjectId> extends true ? <internal>.ObjectId : PathValueType extends "decimal128" | "Decimal128" | typeof <internal>.Decimal128 ? <internal>.Decimal128 : IfEquals<PathValueType, <internal>.Decimal128> extends true ? <internal>.Decimal128 : IfEquals<PathValueType, <internal>.Decimal128> extends true ? <internal>.Decimal128 : PathValueType extends "uuid" | "UUID" | typeof <internal>.UUID ? <internal>.Buffer : IfEquals<PathValueType, <internal>.UUID> extends true ? <internal>.Buffer : PathValueType extends MapConstructor ? Map<string, ResolvePathType<Options["of"]>> : PathValueType extends ArrayConstructor ? any[] : PathValueType extends typeof Mixed ? any : IfEquals<PathValueType, ObjectConstructor> extends true ? any : IfEquals<PathValueType, {}> extends true ? any : PathValueType extends typeof SchemaType ? PathValueType["prototype"] : PathValueType extends <internal>.Record<string, any> ? ObtainDocumentType<PathValueType, any, { typeKey: TypeKey }> : unknown
    summary

    Resolve path type by returning the corresponding type.

    returns

    Number, "Number" or "number" will be resolved to number type.

    Type Parameters

    • PathValueType

      Document definition path type.

    • Options extends SchemaTypeOptions<PathValueType> = {}

      Document definition path options except path type.

    • TypeKey extends string = DefaultSchemaOptions["typeKey"]

      A generic of literal string type."Refers to the property used for path type definition".

    PathsToValidate: string[] | string

    A list of paths to validate. If set, Mongoose will validate only the modified paths that are in the given list.

    ApplyBasicQueryCasting<T>: T | T[] | (T extends (infer U)[] ? U : any) | any

    Type Parameters

    • T

    Type Parameters

    • T

    _FilterQuery<T>: { [ P in keyof T]?: <internal>.Condition<T[P]> } & RootQuerySelector<T>

    Type Parameters

    • T

    FilterQuery<T>: _FilterQuery<T>

    Filter query to select the documents that match the query

    example
    { age: { $gte: 30 } }
    

    Type Parameters

    • T

    MongooseQueryOptions<DocType>: <internal>.Pick<QueryOptions<DocType>, "populate" | "lean" | "strict" | "sanitizeProjection" | "sanitizeFilter">

    Type Parameters

    • DocType = unknown

    ProjectionFields<DocType>: { [ Key in keyof <internal>.Omit<LeanDocument<DocType>, "__v">]?: any } & <internal>.Record<string, any>

    Type Parameters

    • DocType

    QueryWithHelpers<ResultType, DocType, THelpers, RawDocType>: Query<ResultType, DocType, THelpers, RawDocType> & THelpers

    Type Parameters

    • ResultType

    • DocType

    • THelpers = {}

    • RawDocType = DocType

    QuerySelector<T>: { $eq?: T; $gt?: T; $gte?: T; $in?: [T] extends AnyArray<any> ? Unpacked<T>[] : T[]; $lt?: T; $lte?: T; $ne?: T; $nin?: [T] extends AnyArray<any> ? Unpacked<T>[] : T[]; $not?: T extends string ? QuerySelector<T> | RegExp : QuerySelector<T>; $exists?: boolean; $type?: string | number; $expr?: any; $jsonSchema?: any; $mod?: T extends number ? [number, number] : never; $regex?: T extends string ? RegExp | string : never; $options?: T extends string ? string : never; $geoIntersects?: { $geometry: object }; $geoWithin?: object; $near?: object; $nearSphere?: object; $maxDistance?: number; $all?: T extends AnyArray<any> ? any[] : never; $elemMatch?: T extends AnyArray<any> ? object : never; $size?: T extends AnyArray<any> ? number : never; $bitsAllClear?: number | Binary | number[]; $bitsAllSet?: number | Binary | number[]; $bitsAnyClear?: number | Binary | number[]; $bitsAnySet?: number | Binary | number[] }

    Type Parameters

    • T

    Type declaration

    • Optional $eq?: T
    • Optional $gt?: T
    • Optional $gte?: T
    • Optional $in?: [T] extends AnyArray<any> ? Unpacked<T>[] : T[]
    • Optional $lt?: T
    • Optional $lte?: T
    • Optional $ne?: T
    • Optional $nin?: [T] extends AnyArray<any> ? Unpacked<T>[] : T[]
    • Optional $not?: T extends string ? QuerySelector<T> | RegExp : QuerySelector<T>
    • Optional $exists?: boolean

      When true, $exists matches the documents that contain the field, including documents where the field value is null.

    • Optional $type?: string | number
    • Optional $expr?: any
    • Optional $jsonSchema?: any
    • Optional $mod?: T extends number ? [number, number] : never
    • Optional $regex?: T extends string ? RegExp | string : never
    • Optional $options?: T extends string ? string : never
    • Optional $geoIntersects?: { $geometry: object }
      • $geometry: object
    • Optional $geoWithin?: object
    • Optional $near?: object
    • Optional $nearSphere?: object
    • Optional $maxDistance?: number
    • Optional $all?: T extends AnyArray<any> ? any[] : never
    • Optional $elemMatch?: T extends AnyArray<any> ? object : never
    • Optional $size?: T extends AnyArray<any> ? number : never
    • Optional $bitsAllClear?: number | Binary | number[]
    • Optional $bitsAllSet?: number | Binary | number[]
    • Optional $bitsAnyClear?: number | Binary | number[]
    • Optional $bitsAnySet?: number | Binary | number[]
    RootQuerySelector<T>: { $and?: FilterQuery<T>[]; $nor?: FilterQuery<T>[]; $or?: FilterQuery<T>[]; $text?: { $search: string; $language?: string; $caseSensitive?: boolean; $diacriticSensitive?: boolean }; $where?: string | Function; $comment?: string }

    Type Parameters

    • T

    Type declaration

    DefaultTypeKey: "type"
    DefaultType<T>: T extends Mixed ? any : Partial<ExtractMongooseArray<T>>

    Type Parameters

    • T

    IfAny<IFTYPE, THENTYPE, ELSETYPE>: 0 extends 1 & IFTYPE ? THENTYPE : ELSETYPE

    Type Parameters

    • IFTYPE

    • THENTYPE

    • ELSETYPE = IFTYPE

    Unpacked<T>: T extends (infer U)[] ? U : T extends ReadonlyArray<infer U> ? U : T

    Type Parameters

    • T

    UnpackedIntersection<T, U>: T extends null ? null : T extends (infer A)[] ? (<internal>.Omit<A, keyof U> & U)[] : keyof U extends never ? T : <internal>.Omit<T, keyof U> & U

    Type Parameters

    • T

    • U

    MergeType<A, B>: <internal>.Omit<A, keyof B> & B

    Type Parameters

    • A

    • B

    IsItRecordAndNotAny<T>: IfEquals<T, any, false, T extends <internal>.Record<any, any> ? true : false>
    summary

    Checks if a type is "Record" or "any".

    description

    It Helps to check if user has provided schema type "EnforcedDocType"

    returns

    true if {@link T} is Record OR false if {@link T} is of any type.

    Type Parameters

    • T

      A generic type to be checked.

    IfEquals<T, U, Y, N>: (<G>() => G extends T ? 1 : 0) extends (<G>() => G extends U ? 1 : 0) ? Y : N
    summary

    Checks if two types are identical.

    Type Parameters

    • T

      The first type to be compared with {@link U}.

    • U

      The seconde type to be compared with {@link T}.

    • Y = true

      A type to be returned if {@link T} & {@link U} are identical.

    • N = false

      A type to be returned if {@link T} & {@link U} are not identical.

    SchemaValidator<T>: RegExp | [RegExp, string] | Function | [Function, string] | ValidateOpts<T> | ValidateOpts<T>[]

    Type Parameters

    • T

    VirtualPathFunctions<DocType, PathValueType, TInstanceMethods>: { get?: TVirtualPathFN<DocType, PathValueType, TInstanceMethods, PathValueType>; set?: TVirtualPathFN<DocType, PathValueType, TInstanceMethods, void>; options?: VirtualTypeOptions<HydratedDocument<DocType, TInstanceMethods>, DocType> }

    Type Parameters

    • DocType = {}

    • PathValueType = unknown

    • TInstanceMethods = {}

    Type declaration

    TVirtualPathFN<DocType, PathType, TInstanceMethods, TReturn>: (<T>(this: <internal>.Document<any, any, DocType> & DocType, value: PathType, virtual: VirtualType<T>, doc: <internal>.Document<any, any, DocType> & DocType) => TReturn)

    Type Parameters

    • DocType = {}

    • PathType = unknown

    • TInstanceMethods = {}

    • TReturn = unknown

    Type declaration

    SchemaOptionsVirtualsPropertyType<DocType, VirtualPaths, TInstanceMethods>: { [ K in keyof VirtualPaths]: VirtualPathFunctions<IsItRecordAndNotAny<DocType> extends true ? DocType : any, VirtualPaths[K], TInstanceMethods> }

    Type Parameters

    • DocType = any

    • VirtualPaths = <internal>.Record<any, unknown>

    • TInstanceMethods = {}

    IteratorResult<T, TReturn>: <internal>.IteratorYieldResult<T> | <internal>.IteratorReturnResult<TReturn>

    Type Parameters

    • T

    • TReturn = any

    UnicodeBCP47LocaleIdentifier: string

    The locale(s) to use

    MDN.

    LocaleHourCycleKey: "h12" | "h23" | "h11" | "h24"
    LocaleCollationCaseFirst: "upper" | "lower" | "false"
    PropertyKey: string | number | symbol
    Partial<T>: { [ P in keyof T]?: T[P] }

    Make all properties in T optional

    Type Parameters

    • T

    Required<T>: { [ P in keyof T]-?: T[P] }

    Make all properties in T required

    Type Parameters

    • T

    Readonly<T>: { readonly [ P in keyof T]: T[P] }

    Make all properties in T readonly

    Type Parameters

    • T

    Pick<T, K>: { [ P in K]: T[P] }

    From T, pick a set of properties whose keys are in the union K

    Type Parameters

    • T

    • K extends keyof T

    Record<K, T>: { [ P in K]: T }

    Construct a type with a set of properties K of type T

    Type Parameters

    • K extends keyof any

    • T

    Exclude<T, U>: T extends U ? never : T

    Exclude from T those types that are assignable to U

    Type Parameters

    • T

    • U

    Extract<T, U>: T extends U ? T : never

    Extract from T those types that are assignable to U

    Type Parameters

    • T

    • U

    Omit<T, K>: <internal>.Pick<T, <internal>.Exclude<keyof T, K>>

    Construct a type with the properties of T except for those in type K.

    Type Parameters

    • T

    • K extends keyof any

    NonNullable<T>: T & {}

    Exclude null and undefined from T

    Type Parameters

    • T

    Parameters<T>: T extends ((...args: infer P) => any) ? P : never

    Obtain the parameters of a function type in a tuple

    Type Parameters

    • T extends ((...args: any) => any)

    ArrayBufferLike: ArrayBufferTypes[keyof ArrayBufferTypes]
    ReplyCallback<T>: ((content: Error | T) => void)

    Type Parameters

    Type declaration

      • (content: Error | T): void
      • Parameters

        • content: Error | T

        Returns void

    RpcReplyCallback<T>: ((message: <internal>.RabbitMessage<T>, reply: <internal>.ReplyCallback, awkFunc: (() => void) | undefined | Error, err?: Error) => void)

    Type Parameters

    • T

    Type declaration

    PublishCallback<T>: ((message: <internal>.RabbitMessage<T>, err: Error | undefined) => void)

    Type Parameters

    • T

    Type declaration

    QueueCallback: ((message: <internal>.RabbitMessage, err?: Error) => void)

    Type declaration

    RabbitContentType: <internal>.Buffer | string | number | unknown

    Generated using TypeDoc