After spending countless hours searching on Google, I finally gathered the courage to ask my question here.
I have several json
files.
localhost/feed01.json
localhost/feed02.json
localhost/feed03.json
All of the json
file structures are similar to this example, but contain random data such as random, id, date type, etc...
[
{
"id":1,
"date": "12/12/2011",
"type": "Run",
"distance": "3 miles",
"comments": "This was really hard",
"minutes": 36
},
{
"id":2,
"date": "12/11/2011",
"type": "Bike",
"distance": "6 miles",
"comments": "All down hill...felt like nothing",
"minutes": 30
},
{
"id":3,
"date": "12/10/2011",
"type": "Walk",
"distance": "2.5 miles",
"comments": "Shouldn't have taken the dog",
"minutes": 45
}
]
Now, I am looking to combine all these JSON files into one and sort them by date by default (upon initialization). What is the most effective method to merge and sort using backbone.js
utilizing collections?