title: Ruby mongoid aggregation return object
body: <p>I am doing an mongodb aggregation using mongoid, using <code>ModleName.collection.aggregate(pipeline)</code> . The value returned is an array and not a <code>Mongoid::Criteria</code>, so if a do a <code>first</code> on the array, I get the first element which is of the type <code>BSON::Document</code> instead of <code>ModelName</code>. As a result, I am unable to use it as a model.</p>
  
  <p>Is there a method to return a criteria instead of an array from the aggregation, or convert a bson document to a model instance?</p>
  
  <p>Using mongoid (4.0.0)</p>