- I create an array of Objects from a database query and call the array jobListRecords. There are multiple records in the array created that have the same "customerID" and "name".
 - I would like to create a new array that has one record for each customer with a new field , "jobArray", that contains another array of all of that customers services. (see sortCustomer array down below)
 
An example of the initial array:
jobListRecords = [
    { 
    "customerID" : "1",
    "name" : "Larry Bird",
    "serviceID" : "101",
    "serviceName" : "Dog Walking"
    },
    {
    "customerID" : "2",
    "name" : "Andrew Luck",
    "serviceID" : "202",
    "serviceName" : "Baby Sitting"
    },
    {
    "customerID" : "2",
    "name" : "Andrew Luck",
    "serviceID" : "101",
    "serviceName" : "Dog Walking"
    }
]
Desired Result
sortCustomer Example:
sortCustomer = [
   {
   "customerID" : "1",
   "name" : " Larry Bird",
   "jobArray" : [
           {
           "serviceID" : "101",
           "serviceName" : "Dog Walking"
           }
        ]
    },
    {
    "customerID" : "2",
    "name" : "Andrew Luck",
    "jobArray" : [
            {
            "serviceID" : "202",
            "serviceName" : "Baby Sitting"
            },
            {
           "serviceID" : "101",
            "serviceName" : "Dog Walking"
            }
        ]
    }
Is their a simple or efficient way of solving this without having to iterate through all the data 3+ times. Thank You for your time, below is one of the several things I tried.
I tried solving this using one example I found but it grouped all the serviceIDs together which is not what I need.
Example that DID NOT work that I tried.
jobListGrouped = _
    .chain(jobListRecords)
    .groupBy('customerID')
    .map(function(value, key) {
        return {
            CustomerID: key,
            services: _.pluck(value, 'serviceID')
        }
    })
    .value();