(server?: Server)
| 1020 | * @internal |
| 1021 | */ |
| 1022 | export function supportsRetryableWrites(server?: Server): boolean { |
| 1023 | if (!server) { |
| 1024 | return false; |
| 1025 | } |
| 1026 | |
| 1027 | if (server.loadBalanced) { |
| 1028 | // Loadbalanced topologies will always support retry writes |
| 1029 | return true; |
| 1030 | } |
| 1031 | |
| 1032 | if (server.description.logicalSessionTimeoutMinutes != null) { |
| 1033 | // that supports sessions |
| 1034 | if (server.description.type !== ServerType.Standalone) { |
| 1035 | // and that is not a standalone |
| 1036 | return true; |
| 1037 | } |
| 1038 | } |
| 1039 | |
| 1040 | return false; |
| 1041 | } |
| 1042 | |
| 1043 | /** |
| 1044 | * Fisher–Yates Shuffle |
no outgoing calls
no test coverage detected