title: Mongoose: find and select only the fields specified in a virtual
body: <p>I have a <code>UserSchema</code> schema in mongoose:</p>
  
  <pre><code>var UserSchema = new Schema({
    name: String,
    username: String,
    email: String,
    role: {type: String, default: 'user'},
    following: [{type: Schema.ObjectId, ref: 'User'}],
    followers: [{type: Schema.ObjectId, ref: 'User'}],
    hashedPassword: String,
    provider: String,
    salt: String,
    facebook: {},
    twitter: {},
    github: {},
    google: {}
  });
  </code></pre>
  
  <p>I've created a virtual <code>profile</code> which returns only the information for the public profile:</p>
  
  <pre><code>UserSchema
    .virtual('profile')
    .get(function() {
      return {
        'username': this.username,
        'name': this.name,
        'role': this.role
      };
    });
  </code></pre>
  
  <p>My problem is how to get only this information when I'm making a <code>find</code> request. Here's my code:</p>
  
  <pre><code>UserSchema.statics = {
    list: function (options, callback) {
      var criteria = options.criteria || {};
  
      this.find(criteria)
        .select(/* What to put here? */)
        .limit(options.perPage)
        .skip(options.perPage * options.page)
        .exec(callback);
    } 
  };
  </code></pre>
  
  <p>Of course, I can simply put there <code>username</code>, <code>name</code> and <code>role</code> but in that case I'd have code repetition. Can I avoid that?</p>