code: function validateUniqueName(value, respond) {
    // jshint validthis: true
    var self = this;
  
    // check for uniqueness of user name
    this.constructor.findOne({name: value}, function (err, user) {
      if (err) {
        throw err;
      }
  
      if (user) {
        // the searched name is my name or a duplicate
        return respond(self.id === user.id);
      }
  
      respond(true);
    });
  }
docs: Validate the uniqueness of the given username
  
  @api private
  @param {String} value - The username to check for uniqueness
  @param {Function} respond - The callback function