title: How to sort documents based on length of an Array field
body: <p>In my small ExpressJS app, I have a Question model which was defined like that</p>
  
  <pre><code>var mongoose = require('mongoose'),
      Schema   = mongoose.Schema;
  
  /**
   * Question Schema
   */
  var Question = new Schema({
    title: {
      type: String,
      default: '',
      trim: true,
      required: 'Title cannot be blank'
    },
    content: {
      type: String,
      default: '',
      trim: true
    },
    created: {
      type: Date,
      default: Date.now
    },
    updated: {
      type: Date,
      default: Date.now
    },
    author: {
      type: Schema.ObjectId,
      ref: 'User',
      require: true
    },
    answers : [{
      type: Schema.ObjectId,
      ref: 'Answer'
    }]
  });
  
  module.exports = mongoose.model('Question', Question);
  </code></pre>
  
  <p>And I want to get list popular questions based on the answer numbers. The query I used to perform my purpose</p>
  
  <pre><code>Question.find()
    .sort({'answers.length': -1})
    .limit(5)
    .exec(function(err, data) {
      if (err) return next(err);
      return res.status(200).send(data);
    });
  </code></pre>
  
  <p>But I don't get anything. Do you have any solutions?</p>