javascript - Merging two backbone.js collections (outer join) -


i have 2 large json vars lots of data in each represents collection.

since both have similar attributes each object inside each json, make outer join, same attributes stay adding attributes aren't in both (no duplicates)

var json1 = json.parse([{ name: "test_user1", id: 0102 }] var json2 = json.parse([{ name: "test_user2", email: "someemail@gmail.com"}] 

merging both want should produce:

 [{ name: "test_user2", email: "someemail@gmail.com", id: 0102}] 

think json1 , json2 has both same number of objects inside merge obj1 , obj1 json1 , json2 , obj2 , obj2 json1 , json2 , etc...

i misread problem, using at should let merge index position.

collectiona.each(function (model, index) {   model.set(collectionb.at(index).attributes); }); 

Comments

Popular posts from this blog

php - mySql Join with 4 tables -

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -