title: mongoDB aggregation: how to use value as key
body: <p>Hi I've got some records like:</p>
  
  <pre><code>{_id:xxx, user:1, item:A, count: 1}
  {_id:xxx, user:1, item:B, count: 3}
  {_id:xxx, user:2, item:A, count: 5}
  {_id:xxx, user:2, item:B, count: 2}
  </code></pre>
  
  <p>can I get the dict below by using aggregate?</p>
  
  <pre><code>{user:1,{A:1,B:3}, user:2,{A:5,B:2}}
  </code></pre>