title: Aggregate with Mongoid
body: <p>MongoDB has a new <a href="http://docs.mongodb.org/manual/reference/aggregation/" rel="noreferrer">Aggregation Framework</a> and I'm trying to figure out how to use it with Mongoid. It appears there is a branch of Moped with this functionality as discussed <a href="https://github.com/mongoid/moped/issues/49" rel="noreferrer">here</a>. I've updated to MongoDB 2.2 and tried installing this branch of Moped on my app like this:</p>
  <blockquote>
  <p>gem 'moped', git: 'git://github.com/mongoid/moped.git', branch:
  'aggregation-support'</p>
  </blockquote>
  <p>but aggregation is still not working. This is the call I am using to test it:</p>
  <blockquote>
  <p>= Post.all.aggregate({ &quot;$group&quot; =&gt; { &quot;_id&quot; =&gt; &quot;$_id&quot; } })</p>
  </blockquote>
  <p><strong>UPDATE</strong></p>
  <p>In the mongo shell this works:</p>
  <blockquote>
  <p>db.users.aggregate({ $group : { _id : &quot;$_id&quot; }})</p>
  </blockquote>
  <p>so I'm thinking it's a Mongoid issue...any word on this would be great!</p>