code: function(topology) {
    const maxWireVersion = topology.lastIsMaster().maxWireVersion;
    if (maxWireVersion < RETRYABLE_WIRE_VERSION) {
      return false;
    }
  
    if (!topology.logicalSessionTimeoutMinutes) {
      return false;
    }
  
    if (topologyType(topology) === TopologyType.Single) {
      return false;
    }
  
    return true;
  }
docs: Determines whether the provided topology supports retryable writes
  
  @param {Mongos|Replset} topology