API 参考
    正在准备搜索索引...

    类 MongoUnexpectedServerResponseError

    An error generated when a parsable unexpected response comes from the server. This is generally an error where the driver in a state expecting a certain behavior to occur in the next message from MongoDB but it receives something else. This error does not represent an issue with wire message formatting.

    When an operation fails, it is the driver's job to retry it. It must perform serverSelection again to make sure that it attempts the operation against a server in a good state. If server selection returns a server that does not support retryable operations, this error is used. This scenario is unlikely as retryable support would also have been determined on the first attempt but it is possible the state change could report a selectable server that does not support retries.

    层级 (查看层级一览)

    索引

    构造函数

    属性

    cause?: Error
    code?: string | number

    This is a number in MongoServerError and a string in MongoDriverError

    connectionGeneration?: number
    message: string
    stack?: string
    topologyVersion?: TopologyVersion
    prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

    Optional override for formatting stack traces

    stackTraceLimit: number

    访问器

    • get errmsg(): string

      Legacy name for server error responses

      返回 string

    • get errorLabels(): string[]

      返回 string[]

    • get name(): string

      返回 string

    方法

    • 参数

      • label: string

      返回 void

    • Checks the error to see if it has an error label

      参数

      • label: string

        The error label to check for

      返回 boolean

      returns true if the error has the provided error label

    • Create .stack property on a target object

      参数

      • targetObject: object
      • 可选constructorOpt: Function

      返回 void