title: mongoos - Exclude virtual schema fields with populate
body: <p>I have an Item schema which has an owner property which I used to refer to User Schema.. now I'm trying to populate the owner without getting userSchema virtual fields, here are my schemas.</p>
  
  <p><strong>User Schema</strong></p>
  
  <pre><code>let userSchema = new mongoose.Schema({
   name: {type: String},
   email: {type: String},
   phoneNumber: {
     type: String,
     required: true,
     trim: true
   },
   devices: [String],
   verified: {
     phoneNumber: {
       type: Boolean,
       default: false
     }
   },
   settings: {
     showNumber: {type: Boolean},
     showEmail: {type: Boolean}
   },
   role: {
     type: String,
     enum: constants.user.roles,
     required: true,
     default: constants.user.defaultRole
   }
  });
  
  userSchema.virtual('isPhoneVerified').get(function () {
    return !!this.verified.phoneNumber;
  });
  
  module.exports = mongoose.model('user', userSchema);
  </code></pre>
  
  <p><strong>Item Schema</strong></p>
  
  <pre><code>let itemSchema = new mongoose.Schema({
    title: {type: String, required: true},
    price: {type: Number},
    owner: {
      type: mongoose.Schema.Types.ObjectId,
      ref: 'user',
      require: true
    }
  });
  
  let autoPopulate = function(next) {
     this.populate({
       path: 'owner',
      select: {name: 1, _id: 0, isPhoneVerified: 0}
     });
     next();
  };
  
  itemSchema.pre('find', autoPopulate);
  itemSchema.pre('findOne', autoPopulate);
  
  module.exports = mongoose.model('item', itemSchema);
  </code></pre>
  
  <p>so when I'm trying to exclude the <code>isPhoneVerified</code> field I got this error</p>
  
  <p><code>MongoError: Projection cannot have a mix of inclusion and exclusion.</code></p>
  
  <p>Can you please advice me?</p>
  
  <p><strong>Update</strong> 
  I found a solution for this case by using <code>transform</code> property in <code>toJson</code>.</p>
  
  <pre><code>userSchema.set('toJson', {
    virtuals: true,
    getters: true,
    transform: function (doc, ret) {
      delete ret._id;
      delete ret.isPhoneVerified;
      return ret;
    }
  });
  </code></pre>