Created
April 29, 2014 07:47
-
-
Save bosko/11393247 to your computer and use it in GitHub Desktop.
Purchase items regrouping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var purchaseItems = [ | |
{ | |
"id":128449, | |
"name":"Yellow Banana", | |
"product_id":103672, | |
"product_name":"Bananas", | |
"purchase_date":"2014-02-09 00:00:00", | |
"dvp_value":5.6, | |
"nutrient_rate":124.0 | |
}, | |
{ | |
"id":128827, | |
"name":"Bananas", | |
"product_id":103672, | |
"product_name":"Bananas", | |
"purchase_date":"2014-02-13 00:00:00", | |
"dvp_value":5.6, | |
"nutrient_rate":124.0 | |
}, | |
{ | |
"id":140322, | |
"name":"Bananas", | |
"product_id":103672, | |
"product_name":"Bananas", | |
"purchase_date":"2014-03-03 00:00:00", | |
"dvp_value":5.6, | |
"nutrient_rate":124.0 | |
} | |
]; | |
var groupedByProduct = [ | |
{ | |
product_id: 103672, | |
product_name: "Bananas", | |
dvp_value: 5.6, | |
nutrient_rate: 124, | |
purchase_items: [ | |
{ id: 128449, name: "Yellow Banana", purchase_date: "2014-02-09 00:00:00" }, | |
{ id: 128827, name: "Bananas", purchase_date: "2014-02-13 00:00:00" }, | |
{ id: 140322, name: "Bananas", purchase_date: "2014-03-03 00:00:00" } | |
] | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment