title: Grouping a large number of objects via property
body: <p>I'm trying to map a relational database, and piece together the different tables with the column id's. Say I have two tables: <code>cars</code>, <code>owners</code>. The <code>cars</code> table has an <code>owner_id</code> column. I'm trying to map over all <code>owners</code> and add a property to it <code>owners.cars</code>. One simple way is to pull all cars and then run a <code>groupBy</code> function using <code>lodash</code>. Like this.</p>
  
  <pre><code>cars = _.groupBy(cars, 'owner_id`)
  </code></pre>
  
  <p>However, my data-set is so large around 200,000 items, and it seems to just hang the process.</p>
  
  <p>What's the best way to cycle this kind of information? The reverse would be looping over every <code>car</code> and inserting it into the correct <code>owner</code>.</p>
  
  <p>This is kind of a migration from an existing relational postgres database to a nosql mongo database.</p>