Let\'s say I have some Schema which has a virtual field like this
var schema = new mongoose.Schema( { name: { type: String } }, { toObject: { virtual
You won't be able to sort by a virtual field because they are not stored to the database.
Virtual attributes are attributes that are convenient to have around but that do not get persisted to mongodb.
http://mongoosejs.com/docs/2.7.x/docs/virtuals.html