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 Element
Array Element< Type > : Type extends ReadonlyArray < infer Item> ? Item : never
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类型参数
Type declaration类型声明
Parameters参数
Returns 返回 void
Change Stream Document
Type parameters类型参数
Change Stream Events
Change
Stream
Events
< TSchema , TChange > : { 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 }
Type declaration类型声明
ended: function
Parameters参数
Returns 返回 void
Common Events
Common Events: "newListener" | "removeListener"
Condition
Type parameters类型参数
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
Parameters参数
Returns 返回 void
command Failed: function
Parameters参数
Returns 返回 void
command Started: function
Parameters参数
Returns 返回 void
command Succeeded: function
Parameters参数
Returns 返回 void
message: function
message( message: any ) : void
Parameters参数
Returns 返回 void
pinned: function
pinned( pinType: string ) : void
Parameters参数
Returns 返回 void
unpinned: function
unpinned( pinType: string ) : void
Parameters参数
Returns 返回 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 ; connectionPoolReady
: 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: { }
Explain Verbosity
Explain Verbosity: string
Filter
Type parameters类型参数
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类型参数
GSSAPICanonicalization Value
Generic Listener
Generic Listener: ( ... args: any [] ) => void
Type declaration类型声明
Parameters参数
Returns 返回 void
GridFSBucket Events
GridFSBucket Events: { index: any }
Index Direction
Index Direction: -1 | 1 | "2d" | "2dsphere" | "text" | "geoHaystack" | "hashed" | number
Infer Id Type
Infer
Id
Type
< TSchema > : TSchema extends { _id
: infer IdType
} ? Record < any , never > extends IdType ? never : IdType : TSchema extends { _id
?: infer IdType
} ? unknown extends IdType ? ObjectId : IdType : ObjectId
Type parameters类型参数
Is Any
Is Any< Type , ResultIfAny , ResultIfNotAny > : true extends false & Type ? ResultIfAny : ResultIfNotAny
Type parameters类型参数
Type
ResultIfAny
ResultIfNotAny
Join
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类型参数
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类型参数
Type declaration类型声明
Parameters参数
Returns 返回 void
Match Keys And Values
Type parameters类型参数
Monitor Events
Monitor
Events
: { close
: any ; resetConnectionPool
: any ; resetServer
: any ; serverHeartbeatFailed
: any ; serverHeartbeatStarted
: any ; serverHeartbeatSucceeded
: any } & EventEmitterWithState
Nested Paths
Nested
Paths
< Type , Depth > : Depth [ "length" ] extends 8 ? [ ] : Type extends string | number | boolean | Date | RegExp | 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 > ] : [ ]
Type parameters类型参数
Nested Paths Of Type
Type parameters类型参数
Non Object Id Like Document
Non
Object
Id
Like
Document
: { [ key in keyof ObjectIdLike ] ?: never } & Document
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类型参数
Optional Unless Required Id
Optional
Unless
Required
Id
< TSchema > : TSchema extends { _id
: any } ? TSchema : OptionalId < TSchema >
Type parameters类型参数
Projection
Type parameters类型参数
Property Type
Property
Type
< 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类型参数
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 }
Set Fields
Type parameters类型参数
Sort Direction
Sort Direction: 1 | -1 | "asc" | "desc" | "ascending" | "descending" | { $meta: string }
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 ] > >
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 Id
Type parameters类型参数
With Session Callback
Type declaration类型声明
Parameters参数
Returns 返回 Promise < any >
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 Const 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" } > = ...
Const Auto Encryption Logger Level
Auto Encryption Logger Level: Readonly < { Error: 1 ; FatalError: 0 ; Info: 3 ; Trace: 4 ; Warning: 2 } > = ...
Const 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 } > = ...
Const Batch Type
Batch Type: Readonly < { DELETE: 3 ; INSERT: 1 ; UPDATE: 2 } > = ...
Const CURSOR_ FLAGS
CURSOR_ FLAGS: readonly [ "tailable" , "oplogReplay" , "noCursorTimeout" , "awaitData" , "exhaust" , "partial" ] = ...
Const Compressor
Compressor: Readonly < { none: 0 ; snappy: 1 ; zlib: 2 ; zstd: 3 } > = ...
Const Explain Verbosity
Explain Verbosity: Readonly < { allPlansExecution: "allPlansExecution" ; executionStats: "executionStats" ; queryPlanner: "queryPlanner" ; queryPlannerExtended: "queryPlannerExtended" } > = ...
Const GSSAPICanonicalization Value
GSSAPICanonicalization Value: Readonly < { forward: "forward" ; forwardAndReverse: "forwardAndReverse" ; none: "none" ; off: false ; on: true } > = ...
Const LEGAL_ TCP_ SOCKET_ OPTIONS
LEGAL_ TCP_ SOCKET_ OPTIONS: readonly [ "family" , "hints" , "localAddress" , "localPort" , "lookup" ] = ...
Const 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" ] = ...
Const Logger Level
Logger Level: Readonly < { DEBUG: "debug" ; ERROR: "error" ; INFO: "info" ; WARN: "warn" ; debug: "debug" ; error: "error" ; info: "info" ; warn: "warn" } > = ...
Const MONGO_ CLIENT_ EVENTS
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" ] = ...
Map
Map: MapConstructor
Defined in 定义位于 node_modules/bson/bson.d.ts:930
Const Mongo Error Label
Mongo Error Label: Readonly < { HandshakeError: "HandshakeError" ; NoWritesPerformed: "NoWritesPerformed" ; ResetPool: "ResetPool" ; ResumableChangeStreamError: "ResumableChangeStreamError" ; RetryableWriteError: "RetryableWriteError" ; TransientTransactionError: "TransientTransactionError" ; UnknownTransactionCommitResult: "UnknownTransactionCommitResult" } > = ...
Const Profiling Level
Profiling Level: Readonly < { all: "all" ; off: "off" ; slowOnly: "slow_only" } > = ...
Const Read Concern Level
Read Concern Level: Readonly < { available: "available" ; linearizable: "linearizable" ; local: "local" ; majority: "majority" ; snapshot: "snapshot" } > = ...
Const Read Preference Mode
Read Preference Mode: Readonly < { nearest: "nearest" ; primary: "primary" ; primaryPreferred: "primaryPreferred" ; secondary: "secondary" ; secondaryPreferred: "secondaryPreferred" } > = ...
Const Return Document
Return Document: Readonly < { AFTER: "after" ; BEFORE: "before" } > = ...
Const Server Api Version
Server Api Version: Readonly < { v1: "1" } > = ...
Const 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" } > = ...
Const Topology Type
Topology Type: Readonly < { LoadBalanced: "LoadBalanced" ; ReplicaSetNoPrimary: "ReplicaSetNoPrimary" ; ReplicaSetWithPrimary: "ReplicaSetWithPrimary" ; Sharded: "Sharded" ; Single: "Single" ; Unknown: "Unknown" } > = ...
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可以在mongodb中使用其他类型进行搜索,例如字符串类型可以使用mongo中的正则表达式进行搜索数组类型可以使用其元素类型进行搜索