This is a number in MongoServerError and a string in 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
Create .stack property on a target object
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. 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. 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.