I'm saving the game difficulty along with each score in the leaderboard:
scoreBoardService.addJSONObject(leaderboardName, {difficulty: "expert"});
scoreBoardService.saveUserScore(leaderboardName, userName, score, callback);
The game is a played a few times and userName saves a few scores to the leaderboard service with the additional data.
The problem comes when retrieving the leaderboard with these calls:
scoreBoardService.setQuery(leaderboardName, null);
scoreBoardService.getTopNRankersByDate(leaderboardName, startDate, endDate, 100, callback);
The scoreList in the JSON response looks like this:
"scoreList": [{
"facebookArrayList": null,
"createdOn": "Thu Jun 2 07:55:38 GMT-0600 2016",
"scoreId": "_v3OrvR34G9qMazm0pOArtpy10vM+I=",
"docId": null,
"userName": "JackTrash",
"value": 280,
"updatedAt": null,
"event": null,
"jsonDoc": null,
"rank": null,
"createdAt": null,
"jsonDocList": [{
"owner": "JackTrash",
"updatedAt": "Thu Jun 2 07:55:38 GMT-0600 2016",
"event": null,
"jsonDoc": "{\"difficulty\":\"normal\",\"_$scoreId\":\"_v3OrvR34G9qMazm0pOArtpy10vM+I=\"}",
"docId": "57503adae4b015974823fe8b",
"createdAt": "Thu Jun 2 07:55:38 GMT-0600 2016",
"loc": null
},
{
"owner": "JackTrash",
"updatedAt": "Thu Jun 2 08:07:57 GMT-0600 2016",
"event": null,
"jsonDoc": "{\"difficulty\":\"hard\",\"_$scoreId\":\"_v3bbwayk6GOVw5PaLScWiisqkZZU=\"}",
"docId": "57503dbde4b0220cfa7f2a9b",
"createdAt": "Thu Jun 2 08:07:57 GMT-0600 2016",
"loc": null
}],
"owner": null,
"loc": null
}],
My question is around the jsonDocList. It appears to contain a document for every score saved by the user JackTrash (2 in this case) - even though only one of the documents relates to the score returned by getTopNRankersByDate().
Is there a way to limit the jsonDocList to only return the document saved with that particular score?
The concern is that if my top 100 players of the game have played a 100 games each - this call to get the leaderboard is going to be HUGE - with each of the 100 players having 100 JSON docs attached to their score.
Thanks for the help!