Type aliases
AbstractCursorEvents
AbstractCursorEvents: { close: any }
AcceptedFields
AcceptedFields<TSchema, FieldType, AssignableType>
: { readonly [ key in KeysOfAType < TSchema , FieldType > ] ?: AssignableType }
Type parameters类型参数
TSchema
FieldType
AssignableType
AddToSetOperators
AddToSetOperators<Type>
: { $each
?: Flatten < Type > [] }
Type parameters类型参数
AlternativeType
Type parameters类型参数
AnyBulkWriteOperation
Type parameters类型参数
ArrayOperator
ArrayOperator<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
AutoEncryptionLoggerLevel
BitwiseFilter
BitwiseFilter
: number | Binary | ReadonlyArray < number >
Callback
Callback<T>
: ( error
?: AnyError , result
?: T ) => void
Type parameters类型参数
Type declaration类型声明
Parameters参数
Returns返回 void
ChangeStreamEvents
ChangeStreamEvents
: { change
: any ; end
: any ; error
: any ; init
: any ; more
: any ; response
: any ; resumeTokenChanged
: any } & AbstractCursorEvents
ClientSessionEvents
ClientSessionEvents: { ended: any }
Type declaration类型声明
ended: function
Parameters参数
Returns返回 void
CommonEvents
CommonEvents: "newListener" | "removeListener"
Condition
Type parameters类型参数
ConnectionEvents
ConnectionEvents: { close: any ; clusterTimeReceived: any ; commandFailed: any ; commandStarted: any ; commandSucceeded: any ; message: any ; pinned: any ; unpinned: any }
Type declaration类型声明
close: function
clusterTimeReceived: function
clusterTimeReceived( clusterTime: Document ) : void
Parameters参数
Returns返回 void
commandFailed: function
Parameters参数
Returns返回 void
commandStarted: function
Parameters参数
Returns返回 void
commandSucceeded: 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
ConnectionPoolEvents
ConnectionPoolEvents
: { connectionCheckOutFailed
: any ; connectionCheckOutStarted
: any ; connectionCheckedIn
: any ; connectionCheckedOut
: any ; connectionClosed
: any ; connectionCreated
: any ; connectionPoolCleared
: any ; connectionPoolClosed
: any ; connectionPoolCreated
: any ; connectionReady
: any } & Omit < ConnectionEvents , "close" | "message" >
EnhancedOmit
EnhancedOmit<TRecordOrUnion, KeyUnion>: string extends keyof TRecordOrUnion ? TRecordOrUnion : TRecordOrUnion extends any ? Pick < TRecordOrUnion , Exclude < keyof TRecordOrUnion , KeyUnion > > : never
Type parameters类型参数
EventEmitterWithState
EventEmitterWithState: { stateChanged: any }
Type declaration类型声明
stateChanged: function
stateChanged( previous: string , current: string ) : void
Parameters参数
previous: string
current: string
Returns返回 void
ExplainVerbosity
ExplainVerbosity: string
Filter
Type parameters类型参数
FilterOperations
Type parameters类型参数
FinalizeFunction
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
Flatten<Type>: Type extends ReadonlyArray < infer Item> ? Item : Type
Type parameters类型参数
GenericListener
GenericListener: ( ... args: any [] ) => void
Type declaration类型声明
Parameters参数
Returns返回 void
GridFSBucketEvents
GridFSBucketEvents: { index: any }
IndexDirection
IndexDirection: -1 | 1 | "2d" | "2dsphere" | "text" | "geoHaystack" | number
InferIdType
InferIdType<TSchema>
: TSchema extends { _id
: infer IdType
} ? {} extends IdType ? Exclude < IdType , {} > : unknown extends IdType ? ObjectId : IdType : ObjectId
Type parameters类型参数
InternalAbstractCursorOptions
IsAny
IsAny<Type, ResultIfAny, ResultIfNotAny>: true extends false & Type ? ResultIfAny : ResultIfNotAny
Type parameters类型参数
Type
ResultIfAny
ResultIfNotAny
KeysOfAType
KeysOfAType<TSchema, Type>: { [ key in keyof TSchema ] : NonNullable < TSchema [ key ] > extends Type ? key : never } [ keyof TSchema ]
Type parameters类型参数
KeysOfOtherType
KeysOfOtherType<TSchema, Type>: { [ key in keyof TSchema ] : NonNullable < TSchema [ key ] > extends Type ? never : key } [ keyof TSchema ]
Type parameters类型参数
ListDatabasesResult
ListDatabasesResult
: string [] | Document []
LoggerFunction
LoggerFunction: ( message?: any , ... optionalParams: any [] ) => void
Type declaration类型声明
( message?: any , ... optionalParams: any [] ) : void
Parameters参数
Optional message: any
Rest ... optionalParams: any []
Returns返回 void
MapFunction
MapFunction<TSchema>: ( this: TSchema ) => void
Type parameters类型参数
Type declaration类型声明
Parameters参数
Returns返回 void
MatchKeysAndValues
MatchKeysAndValues<TSchema>: Readonly < Partial < TSchema > > & Record < string , any >
Type parameters类型参数
MonitorEvents
MonitorEvents
: { close
: any ; resetConnectionPool
: any ; resetServer
: any ; serverHeartbeatFailed
: any ; serverHeartbeatStarted
: any ; serverHeartbeatSucceeded
: any } & EventEmitterWithState
NotAcceptedFields
NotAcceptedFields<TSchema, FieldType>
: { readonly [ key in KeysOfOtherType < TSchema , FieldType > ] ?: never }
Type parameters类型参数
OneOrMore
OneOrMore<T>: T | ReadonlyArray < T >
Type parameters类型参数
OnlyFieldsOfType
OnlyFieldsOfType<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
OptionalId
Type parameters类型参数
Projection
Type parameters类型参数
PullAllOperator
PullAllOperator<TSchema>
: { readonly [ key in KeysOfAType < TSchema , ReadonlyArray < any > > ] ?: TSchema [ key ] } & NotAcceptedFields < TSchema , ReadonlyArray < any > > & {}
Type parameters类型参数
PullOperator
Type parameters类型参数
PushOperator
Type parameters类型参数
ReduceFunction
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
RegExpOrString<T>
: T extends string ? BSONRegExp | RegExp | T : T
Type parameters类型参数
ResumeToken
ResumeToken: unknown
SchemaMember
SchemaMember<T, V>: { [ P in keyof T ] : V } | {}
Type parameters类型参数
ServerEvents
ServerEvents
: { closed
: any ; connect
: any ; descriptionReceived
: any ; ended
: any ; serverHeartbeatFailed
: any ; serverHeartbeatStarted
: any ; serverHeartbeatSucceeded
: any } & ConnectionPoolEvents & EventEmitterWithState
ServerSessionId
ServerSessionId
: { id
: Binary }
SetFields
Type parameters类型参数
SortDirection
SortDirection: 1 | -1 | "asc" | "desc" | "ascending" | "descending" | { $meta: string }
SortDirectionForCmd
SortDirectionForCmd: 1 | -1 | { $meta: string }
SrvPollerEvents
SrvPollerEvents: { srvRecordDiscovery: any }
Type declaration类型声明
srvRecordDiscovery: function
Parameters参数
Returns返回 void
Stream
Stream: Socket | TLSSocket
SupportedNodeConnectionOptions
SupportedTLSConnectionOptions
SupportedTLSConnectionOptions
: Pick < TLSConnectionOptions , Extract < keyof TLSConnectionOptions , typeof LEGAL_TLS_SOCKET_OPTIONS [ number ] > >
SupportedTLSSocketOptions
SupportedTLSSocketOptions
: Pick < TLSSocketOptions , Extract < keyof TLSSocketOptions , typeof LEGAL_TLS_SOCKET_OPTIONS [ number ] > >
TimerQueue
TimerQueue: Set < NodeJS.Timeout >
UpdateFilter
UpdateFilter<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类型参数
WithConnectionCallback
Type declaration类型声明
Parameters参数
Returns返回 void
WithId
Type parameters类型参数
WithSessionCallback
WithSessionCallback
: ( session
: ClientSession ) => Promise < any > | void
Type declaration类型声明
Parameters参数
Returns返回 Promise < any > | void
WithTransactionCallback
WithTransactionCallback<T>
: ( session
: ClientSession ) => Promise < T >
Type parameters类型参数
Type declaration类型声明
Parameters参数
Returns返回 Promise < T >
WithoutId
WithoutId<TSchema>: Omit < TSchema , "_id" >
Type parameters类型参数
Variables
Const AuthMechanism
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" } > = ...
Const AutoEncryptionLoggerLevel
AutoEncryptionLoggerLevel: 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 BatchType
BatchType: 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 } > = ...
Const DB_AGGREGATE_COLLECTION
DB_AGGREGATE_COLLECTION: 1 = ...
Const ExplainVerbosity
ExplainVerbosity: Readonly < { allPlansExecution: "allPlansExecution" ; executionStats: "executionStats" ; queryPlanner: "queryPlanner" ; queryPlannerExtended: "queryPlannerExtended" } > = ...
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 LoggerLevel
LoggerLevel: 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" , "connectionPoolClosed" , "connectionCreated" , "connectionReady" , "connectionClosed" , "connectionCheckOutStarted" , "connectionCheckOutFailed" , "connectionCheckedOut" , "connectionCheckedIn" , "connectionPoolCleared" , "close" | "commandStarted" | "commandSucceeded" | "commandFailed" | "serverHeartbeatStarted" | "serverHeartbeatSucceeded" | "serverHeartbeatFailed" | "serverOpening" | "serverClosed" | "serverDescriptionChanged" | "topologyOpening" | "topologyClosed" | "topologyDescriptionChanged" | "error" | "timeout" ] = ...
Let Map
Map: MapConstructor
Defined in 定义位置: node_modules/bson/bson.d.ts:797
Const ProfilingLevel
ProfilingLevel: Readonly < { all: "all" ; off: "off" ; slowOnly: "slow_only" } > = ...
Const ReadConcernLevel
ReadConcernLevel: Readonly < { available: "available" ; linearizable: "linearizable" ; local: "local" ; majority: "majority" ; snapshot: "snapshot" } > = ...
Const ReadPreferenceMode
ReadPreferenceMode: Readonly < { nearest: "nearest" ; primary: "primary" ; primaryPreferred: "primaryPreferred" ; secondary: "secondary" ; secondaryPreferred: "secondaryPreferred" } > = ...
Const ReturnDocument
ReturnDocument: Readonly < { AFTER: "after" ; BEFORE: "before" } > = ...
Const ServerApiVersion
ServerApiVersion: Readonly < { v1: "1" } > = ...
Const ServerType
ServerType: Readonly < { LoadBalancer: "LoadBalancer" ; Mongos: "Mongos" ; PossiblePrimary: "PossiblePrimary" ; RSArbiter: "RSArbiter" ; RSGhost: "RSGhost" ; RSOther: "RSOther" ; RSPrimary: "RSPrimary" ; RSSecondary: "RSSecondary" ; Standalone: "Standalone" ; Unknown: "Unknown" } > = ...
Const TopologyType
TopologyType: Readonly < { LoadBalanced: "LoadBalanced" ; ReplicaSetNoPrimary: "ReplicaSetNoPrimary" ; ReplicaSetWithPrimary: "ReplicaSetWithPrimary" ; Sharded: "Sharded" ; Single: "Single" ; Unknown: "Unknown" } > = ...
Const TxnState
TxnState: 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