I’m trying to build a basic structure with backbone.js. My issue is that the server will not directly return an array of objects in json format, but an object which has the the desired array of objects embeded inside:
{"meta": {"limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 2}, "objects": [{...},{...} {...}]}
In this case what I really want in my collection is the “objects” property. So when I try to build a backbone collection, I’m not sure if I should iterate and add them manually or there is someway I can map it directly to the objects property of the object.
Hope thats understandable… thanks!
Use the collection.parse(response) function: