MCPcopy
hub / github.com/mongodb/node-mongodb-native / supportsRetryableWrites

Function supportsRetryableWrites

src/utils.ts:1022–1041  ·  view source on GitHub ↗
(server?: Server)

Source from the content-addressed store, hash-verified

1020 * @internal
1021 */
1022export 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

Callers 2

decorateCommandErrorMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected