title: only fields are allowed in a $sort mongodb
body: <p>I am trying to do get nearest records like below but the sort operation complained to expressions not allowed. How can achieve this in MongoDB?</p>
  <h3>Error:</h3>
  <blockquote>
  <p><strong>NotSupportedException: Only fields are allowed in a $sort.</strong>
  <em>MongoDB.Driver.Linq.Translators.QueryableTranslator.TranslateOrderBy(OrderByExpression
  node)</em></p>
  </blockquote>
  <h3>Code:</h3>
  <pre><code>public virtual List&lt;Post&gt; PagingNearest(Expression&lt;Func&lt;Post, bool&gt;&gt; predicate, int offset, int limit, GeoCoordinatePortable.GeoCoordinate coord)
  {
      return _context.Posts.AsQueryable()
               .Where(predicate)
               .OrderBy(x =&gt; x.Location.GeoCoordinate.GetDistanceTo(coord))
               .Skip(offset)
               .Take(limit)
               .ToList();
  }
  </code></pre>