title: Mongoid, get distance from models in kilometers
body: <p>I have model <code>Shop</code> which has this field for geolocation:</p>
  
  <pre><code> class Shop
     include Mongoid::Document
     field :location, type: Array
  
     index( { location: '2d' }, { min: -180, max: 180 })
     before_save :fix_location, if: :location_changed?
     def fix_location
      self.location = self.location.map(&amp;:to_f)
     end
   end
  </code></pre>
  
  <p>I have created indexes for my models.</p>
  
  <p>Then I want to find shops which are around 50 kilometers:</p>
  
  <pre><code>  distance = 50 # km
    loc = [lat, lng]
  
    Shop.where(location: {"$near" =&gt; loc , "$maxDistance" =&gt; distance.fdiv(111.12)})
  </code></pre>
  
  <p>This method works fine and gives my models that I need. However, how to determine how far (in kilometers) are they from my location?</p>
  
  <p>Do I need to use aggregation?</p>