title: How to construct an 'nested' object from timeseries data?
body: <p>I'm extracting time series data for cars using node.js and sql.</p>
  
  <p>My query extracts the data in node.js, and it is available as <em>rawposdata</em>:</p>
  
  <pre><code>rawposdata =
  [{carID: 1234,
     contact: 'john doe',
     TimeStamp: 10:00,
     Speed = 2.3},
  {carID: 1234,
     contact: 'john doe',
     TimeStamp: 11:00,
     Speed = 2.4},
  {carID: 1234,
     contact: 'john doe',
     TimeStamp: 12:00,
     Speed = 2.5}
  {carID: 9876,
     contact: 'bob wills',
     TimeStamp: 10:00,
     Speed = 1.1},
  {carID: 9876,
     contact: 'bob wills',
     TimeStamp: 11:05,
     Speed = 1.1},
  {carID: 9876,
     contact: 'bob wills',
     TimeStamp: 12:00,
     Speed = 3.2},
  ]
  </code></pre>
  
  <p>I want to have it in the following form (array, obj, or whatever) so i can work with it:</p>
  
  <pre><code>mypositiondata = 
  [carID: 1234,
   contact: 'john doe',
   timestamp: { ts0: 10:00,
                ts1: 11:00,
                ts2: 12:00},
   speed:     {s0: 2.3
               s1: 2.4
               s2: 2.5}],
  [carID: 9876,
   contact: 'bob wills',
   timestamp: { ts0: 10:00,
                ts1: 11:05,
                ts2: 12:00},
   speed:     {s0: 1.1
               s1: 1.1
               s2: 3.2}]
  </code></pre>
  
  <p>I have looked through examples on the internet, read underscore docs. etc but it seems i'm not able to solve this. How can i structure this data?</p>
  
  <p>I have somewhere between 50 and 150 cars to sort.
  There are more both static (e.g.: carID) and dynamic (.e.g: speed) datapoints in the dataset.</p>