如何將兩個對象(得分&人)加入到一個對象(已加入)中。我很苦惱,因爲我不喜歡使用JavaScript,而且我正在使用Meteor + Mongo組合。如何模仿使用JavaScript加入SQL
var scores = [
{person_id: "1", score_math: 9, score_biology: 9, score_chemistry: 9},
{person_id: "2", score_math: 9, score_biology: 8, score_chemistry: 9}
];
var persons = [
{person_id: "1", person_name: "Bob", home_country: "Wakerly", age: 12},
{person_id: "2", person_name: "Arnie", home_country: "Templeton", age: 15},
{person_id: "3", person_name: "Steve", home_country: "Elberon", age: 10}
];
var joined = [
{person_id: "1", person_name: "Bob", home_country: "Wakerly", score_math: 9, score_biology: 9, score_chemistry: 9},
{person_id: "2", person_name: "Arnie", home_country: "Templeton", score_math: 9, score_biology: 8, score_chemistry: 9},
{person_id: "3", person_name: "Steve", home_country: "Elberon", score_math: 0, score_biology: 0, score_chemistry: 0}];