docs: function auth(server) {
      // Arguments without a callback
      var argsWithoutCallback = [mechanism, db].concat(args.slice(0));
      // Create arguments
      var finalArguments = argsWithoutCallback.concat([
        function(err) {
          count = count - 1;
          // Save all the errors
          if (err) errors.push({ name: server.name, err: err });
          // We are done
          if (count === 0) {
            // Auth is done
            self.authenticating = false;
  
            // Return the auth error
            if (errors.length) {
              // Remove the entry from the stored authentication contexts
              self.s.authenticationContexts.splice(currentContextIndex, 0);
              // Return error
              return callback(
                new MongoError({
                  message: 'authentication fail',
                  errors: errors
                }),
                false
              );
            }
  
            // Successfully authenticated session
            callback(null, self);
          }
        }
      ]);
  
      // Execute the auth only against non arbiter servers
      if (!server.lastIsMaster().arbiterOnly) {
        server.auth.apply(server, finalArguments);
      }
    }