This is a number in MongoServerError and a string in MongoDriverError这是MongoServerError中的数字和MongoDriverError的字符串
Optional override for formatting stack traces格式化堆栈跟踪的可选替代
Legacy name for server error responses服务器错误响应的旧名称
Checks the error to see if it has an error label检查错误以查看它是否有错误标签
The error label to check for要检查的错误标签
returns true if the error has the provided error label如果错误具有提供的错误标签,则返回true
Create 在目标对象上创建.stack
property on a target object.stack
属性
Generated 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.这种情况不太可能发生,因为第一次尝试时也会确定可重试支持,但状态更改可能会报告不支持重试的可选服务器。