Type aliases Abstract Cursor Events Abstract Cursor Events: { close: any }
Accepted Fields Accepted
Fields<TSchema, FieldType, AssignableType>
: { readonly [ key in KeysOfAType < TSchema , FieldType > ] ?: AssignableType } Type parameters TSchema FieldType AssignableType Add To Set Operators Add
To
Set
Operators<Type>
: { $each
?: Flatten < Type > [] } Type parameters Alternative Type Type parameters Any Bulk Write Operation Type parameters Array Operator Array
Operator<Type>
: { $each
?: Flatten < Type > [] ; $position
?: number ; $slice
?: number ; $sort
?: Sort } Type parameters Type declaration Optional $each?: Flatten < Type > [] Optional $position?: number Optional $slice?: number Optional $sort?: Sort Auto Encryption Logger Level Bitwise Filter Bitwise
Filter
: number | Binary | ReadonlyArray < number > Callback Callback<T>
: ( error
?: AnyError , result
?: T ) => void Type parameters Change Stream Events Change
Stream
Events<TSchema>
: { change
: any ; end
: any ; error
: any ; init
: any ; more
: any ; response
: any ; resumeTokenChanged
: any } & AbstractCursorEvents Type parameters Client Session Events Client Session Events: { ended: any }
Common Events Common Events: "newListener" | "removeListener"
Connection Events Connection Events: { close: any ; clusterTimeReceived: any ; commandFailed: any ; commandStarted: any ; commandSucceeded: any ; message: any ; pinned: any ; unpinned: any }
Type declaration close: function cluster Time Received: function cluster Time Received( clusterTime: Document ) : void command Failed: function command Started: function command Succeeded: function message: function message( message: any ) : void pinned: function pinned( pinType: string ) : void unpinned: function unpinned( pinType: string ) : void Connection Pool Events Connection
Pool
Events
: { connectionCheckOutFailed
: any ; connectionCheckOutStarted
: any ; connectionCheckedIn
: any ; connectionCheckedOut
: any ; connectionClosed
: any ; connectionCreated
: any ; connectionPoolCleared
: any ; connectionPoolClosed
: any ; connectionPoolCreated
: any ; connectionReady
: any } & Omit < ConnectionEvents , "close" | "message" > Enhanced Omit Enhanced Omit<TRecordOrUnion, KeyUnion>: string extends keyof TRecordOrUnion ? TRecordOrUnion : TRecordOrUnion extends any ? Pick < TRecordOrUnion , Exclude < keyof TRecordOrUnion , KeyUnion > > : never
Type parameters Event Emitter With State Event Emitter With State: { stateChanged: any }
Type declaration state Changed: function state Changed( previous: string , current: string ) : void Parameters previous: string current: string Returns void Explain Verbosity Explain Verbosity: string
Filter Operations Type parameters Finalize Function Finalize Function<TKey, TValue>: ( key: TKey , reducedValue: TValue ) => TValue
Type parameters Type declaration ( key: TKey , reducedValue: TValue ) : TValue Parameters key: TKey reducedValue: TValue Returns TValue Flatten Flatten<Type>: Type extends ReadonlyArray < infer Item> ? Item : Type
Type parameters Generic Listener Generic Listener: ( ... args: any [] ) => void
GridFSBucket Events GridFSBucket Events: { index: any }
Index Direction Index Direction: -1 | 1 | "2d" | "2dsphere" | "text" | "geoHaystack" | number
Infer Id Type Infer
Id
Type<TSchema>
: TSchema extends { _id
: infer IdType
} ? {} extends IdType ? Exclude < IdType , {} > : unknown extends IdType ? ObjectId : IdType : ObjectId Type parameters Internal Abstract Cursor Options Is Any Is Any<Type, ResultIfAny, ResultIfNotAny>: true extends false & Type ? ResultIfAny : ResultIfNotAny
Type parameters Type ResultIfAny ResultIfNotAny Keys OfAType Keys OfAType<TSchema, Type>: { [ key in keyof TSchema ] : NonNullable < TSchema [ key ] > extends Type ? key : never } [ keyof TSchema ]
Type parameters Keys Of Other Type Keys Of Other Type<TSchema, Type>: { [ key in keyof TSchema ] : NonNullable < TSchema [ key ] > extends Type ? never : key } [ keyof TSchema ]
Type parameters Logger Function Logger Function: ( message?: any , ... optionalParams: any [] ) => void
Type declaration ( message?: any , ... optionalParams: any [] ) : void Parameters Optional message: any Rest ... optionalParams: any [] Returns void Map Function Map Function<TSchema>: ( this: TSchema ) => void
Type parameters Match Keys And Values Match Keys And Values<TSchema>: Readonly < Partial < TSchema > > & Record < string , any >
Type parameters Monitor Events Monitor
Events
: { close
: any ; resetConnectionPool
: any ; resetServer
: any ; serverHeartbeatFailed
: any ; serverHeartbeatStarted
: any ; serverHeartbeatSucceeded
: any } & EventEmitterWithState Not Accepted Fields Not
Accepted
Fields<TSchema, FieldType>
: { readonly [ key in KeysOfOtherType < TSchema , FieldType > ] ?: never } Type parameters One Or More One Or More<T>: T | ReadonlyArray < T >
Type parameters Only Fields Of Type Only
Fields
Of
Type<TSchema, FieldType, AssignableType>
: IsAny < TSchema [ keyof TSchema ] , Record < string , FieldType > , AcceptedFields < TSchema , FieldType , AssignableType > & NotAcceptedFields < TSchema , FieldType > & Record < string , AssignableType > > Type parameters TSchema FieldType = any AssignableType = FieldType Optional Id Type parameters Projection Type parameters Pull All Operator Pull
All
Operator<TSchema>
: ( { readonly [ key in KeysOfAType < TSchema , ReadonlyArray < any > > ] ?: TSchema [ key ] } & NotAcceptedFields < TSchema , ReadonlyArray < any > > ) & {} Type parameters Pull Operator Type parameters Push Operator Type parameters Reduce Function Reduce Function<TKey, TValue>: ( key: TKey , values: TValue [] ) => TValue
Type parameters Type declaration ( key: TKey , values: TValue [] ) : TValue Parameters key: TKey values: TValue [] Returns TValue Reg Exp Or String Reg
Exp
Or
String<T>
: T extends string ? BSONRegExp | RegExp | T : T Type parameters Resume Token Resume Token: unknown
Schema Member Schema Member<T, V>: { [ P in keyof T ] ?: V } | {}
Type parameters Server Events Server
Events
: { closed
: any ; connect
: any ; descriptionReceived
: any ; ended
: any ; serverHeartbeatFailed
: any ; serverHeartbeatStarted
: any ; serverHeartbeatSucceeded
: any } & ConnectionPoolEvents & EventEmitterWithState Server Session Id Server
Session
Id
: { id
: Binary } Sort Direction Sort Direction: 1 | -1 | "asc" | "desc" | "ascending" | "descending" | { $meta: string }
Sort Direction For Cmd Sort Direction For Cmd: 1 | -1 | { $meta: string }
Srv Poller Events Srv Poller Events: { srvRecordDiscovery: any }
Type declaration srv Record Discovery: function Stream Stream: Socket | TLSSocket
Supported Node Connection Options SupportedTLSConnection Options SupportedTLSConnection
Options
: Pick < TLSConnectionOptions , Extract < keyof TLSConnectionOptions , typeof LEGAL_TLS_SOCKET_OPTIONS [ number ] > > SupportedTLSSocket Options SupportedTLSSocket
Options
: Pick < TLSSocketOptions , Extract < keyof TLSSocketOptions , typeof LEGAL_TLS_SOCKET_OPTIONS [ number ] > > Timer Queue Timer Queue: Set < NodeJS.Timeout >
Update Filter Update
Filter<TSchema>
: { $addToSet
?: SetFields < TSchema > ; $bit
?: OnlyFieldsOfType < TSchema , NumericType | undefined , { and
: IntegerType } | { or
: IntegerType } | { xor
: IntegerType } > ; $currentDate
?: OnlyFieldsOfType < TSchema , Date | Timestamp , true | { $type
: "date" | "timestamp" } > ; $inc
?: OnlyFieldsOfType < TSchema , NumericType | undefined > ; $max
?: MatchKeysAndValues < TSchema > ; $min
?: MatchKeysAndValues < TSchema > ; $mul
?: OnlyFieldsOfType < TSchema , NumericType | undefined > ; $pop
?: OnlyFieldsOfType < TSchema , ReadonlyArray < any > , 1 | -1 > ; $pull
?: PullOperator < TSchema > ; $pullAll
?: PullAllOperator < TSchema > ; $push
?: PushOperator < TSchema > ; $rename
?: Record < string , string > ; $set
?: MatchKeysAndValues < TSchema > ; $setOnInsert
?: MatchKeysAndValues < TSchema > ; $unset
?: OnlyFieldsOfType < TSchema , any , "" | true | 1 > } & Document Type parameters With Session Callback With
Session
Callback
: ( session
: ClientSession ) => Promise < any > | void Type declaration Parameters Returns Promise < any > | void With Transaction Callback With
Transaction
Callback<T>
: ( session
: ClientSession ) => Promise < T > Type parameters Type declaration Parameters Returns Promise < T > Without Id Without Id<TSchema>: Omit < TSchema , "_id" >
Type parameters Variables Auth Mechanism Auth Mechanism: 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" } > = ...
Auto Encryption Logger Level Auto Encryption Logger Level: Readonly < { Error: 1 ; FatalError: 0 ; Info: 3 ; Trace: 4 ; Warning: 2 } > = ...
BSONType BSONType: Readonly < { array: 4 ; binData: 5 ; bool: 8 ; date: 9 ; dbPointer: 12 ; decimal: 19 ; double: 1 ; int: 16 ; javascript: 13 ; javascriptWithScope: 15 ; long: 18 ; maxKey: 127 ; minKey: -1 ; null: 10 ; object: 3 ; objectId: 7 ; regex: 11 ; string: 2 ; symbol: 14 ; timestamp: 17 ; undefined: 6 } > = ...
Batch Type Batch Type: Readonly < { DELETE: 3 ; INSERT: 1 ; UPDATE: 2 } > = ...
CURSOR_ FLAGS CURSOR_ FLAGS: readonly [ "tailable" , "oplogReplay" , "noCursorTimeout" , "awaitData" , "exhaust" , "partial" ] = ...
Compressor Compressor: Readonly < { none: 0 ; snappy: 1 ; zlib: 2 } > = ...
DB_ AGGREGATE_ COLLECTION DB_ AGGREGATE_ COLLECTION: 1 = ...
Explain Verbosity Explain Verbosity: Readonly < { allPlansExecution: "allPlansExecution" ; executionStats: "executionStats" ; queryPlanner: "queryPlanner" ; queryPlannerExtended: "queryPlannerExtended" } > = ...
LEGAL_ TCP_ SOCKET_ OPTIONS LEGAL_ TCP_ SOCKET_ OPTIONS: readonly [ "family" , "hints" , "localAddress" , "localPort" , "lookup" ] = ...
LEGAL_ TLS_ SOCKET_ OPTIONS LEGAL_ TLS_ SOCKET_ OPTIONS: readonly [ "ALPNProtocols" , "ca" , "cert" , "checkServerIdentity" , "ciphers" , "crl" , "ecdhCurve" , "key" , "minDHSize" , "passphrase" , "pfx" , "rejectUnauthorized" , "secureContext" , "secureProtocol" , "servername" , "session" ] = ...
Logger Level Logger Level: Readonly < { DEBUG: "debug" ; ERROR: "error" ; INFO: "info" ; WARN: "warn" ; debug: "debug" ; error: "error" ; info: "info" ; warn: "warn" } > = ...
MONGO_ CLIENT_ EVENTS MONGO_ CLIENT_ EVENTS: readonly [ "connectionPoolCreated" , "connectionPoolClosed" , "connectionCreated" , "connectionReady" , "connectionClosed" , "connectionCheckOutStarted" , "connectionCheckOutFailed" , "connectionCheckedOut" , "connectionCheckedIn" , "connectionPoolCleared" , "close" | "commandStarted" | "commandSucceeded" | "commandFailed" | "serverHeartbeatStarted" | "serverHeartbeatSucceeded" | "serverHeartbeatFailed" | "serverOpening" | "serverClosed" | "serverDescriptionChanged" | "topologyOpening" | "topologyClosed" | "topologyDescriptionChanged" | "error" | "timeout" ] = ...
Map Map: MapConstructor
Defined in node_modules/bson/bson.d.ts:821 Profiling Level Profiling Level: Readonly < { all: "all" ; off: "off" ; slowOnly: "slow_only" } > = ...
Read Concern Level Read Concern Level: Readonly < { available: "available" ; linearizable: "linearizable" ; local: "local" ; majority: "majority" ; snapshot: "snapshot" } > = ...
Read Preference Mode Read Preference Mode: Readonly < { nearest: "nearest" ; primary: "primary" ; primaryPreferred: "primaryPreferred" ; secondary: "secondary" ; secondaryPreferred: "secondaryPreferred" } > = ...
Return Document Return Document: Readonly < { AFTER: "after" ; BEFORE: "before" } > = ...
Server Api Version Server Api Version: Readonly < { v1: "1" } > = ...
Server Type Server Type: Readonly < { LoadBalancer: "LoadBalancer" ; Mongos: "Mongos" ; PossiblePrimary: "PossiblePrimary" ; RSArbiter: "RSArbiter" ; RSGhost: "RSGhost" ; RSOther: "RSOther" ; RSPrimary: "RSPrimary" ; RSSecondary: "RSSecondary" ; Standalone: "Standalone" ; Unknown: "Unknown" } > = ...
Topology Type Topology Type: Readonly < { LoadBalanced: "LoadBalanced" ; ReplicaSetNoPrimary: "ReplicaSetNoPrimary" ; ReplicaSetWithPrimary: "ReplicaSetWithPrimary" ; Sharded: "Sharded" ; Single: "Single" ; Unknown: "Unknown" } > = ...
Txn State Txn State: Readonly < { NO_TRANSACTION: "NO_TRANSACTION" ; STARTING_TRANSACTION: "STARTING_TRANSACTION" ; TRANSACTION_ABORTED: "TRANSACTION_ABORTED" ; TRANSACTION_COMMITTED: "TRANSACTION_COMMITTED" ; TRANSACTION_COMMITTED_EMPTY: "TRANSACTION_COMMITTED_EMPTY" ; TRANSACTION_IN_PROGRESS: "TRANSACTION_IN_PROGRESS" } > = ...
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