私はParse.comJavascriptAPI(Backbone)を使用しています。
結果(モデルの配列)をにadd
しようとしていますが、次のエラーが発生します:Query
collection
Duplicate id: can't add the same model to a collection twice.
サンプル:
var GameScore = Parse.Object.extend("GameScore");
// A Collection containing all instances of TestObject.
var TestCollection = Parse.Collection.extend({
model: GameScore
});
var collection = new TestCollection();
var query = new Parse.Query(GameScore);
query.equalTo("playerName", "Dan Stemkoski");
query.find({
success: function(results) {
collection.add(results);
},
error: function(error) {}
});
質問:
重複モデルを無視してaddメソッドを呼び出すことは可能ですか?