Do not use this constructor!不要使用此构造函数!
Meant for internal use only.仅供内部使用。
This class is only meant to be constructed within the driver. 这个类只能在驱动程序中构造。This constructor is not subject to semantic versioning compatibility guarantees and may change at any time.此构造函数不受语义版本控制兼容性保证的约束,并且可能随时更改。
Optional
causeOptional
codeThis is a number in MongoServerError and a string in MongoDriverError这是MongoServerError中的一个数字,也是MongoDriverError中的字符串
Optional
connectionOptional
stackOptional
topologyStatic
Optional
prepareOptional override for formatting stack traces格式化堆栈跟踪的可选覆盖
Static
stackLegacy name for server error responses服务器错误响应的旧名称
Static
captureGenerated using TypeDoc
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.这通常是一个错误,驱动程序处于期望某个行为在来自MongoDB的下一条消息中发生的状态,但它收到了其他东西。This error does not represent an issue with wire message formatting.此错误并不表示电报格式有问题。Example
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.它必须再次执行serverSelection,以确保尝试对处于良好状态的服务器执行操作。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.这种情况不太可能发生,因为在第一次尝试时也会确定可重试支持,但状态更改可能会报告不支持重试的可选服务器。