Depending on the driver version you are using, it’s likely that the driver supports Retryable Reads and Writes by default (both are enabled by default in drivers compatible with MongoDB 4.2+). Note that retryable reads and writes make only one retry attempt.
and