mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-28 01:55:38 -05:00
Use level instead of levelID for getHistogramData to hit the index we already have
This commit is contained in:
parent
cea412c0a9
commit
acdfe7c1c4
1 changed files with 4 additions and 3 deletions
|
@ -182,10 +182,11 @@ LevelHandler = class LevelHandler extends Handler
|
|||
query.exec (err, results) =>
|
||||
if err then @sendDatabaseError(res, err) else @sendSuccess res, results
|
||||
|
||||
getHistogramData: (req, res, slug) ->
|
||||
match = levelID: slug, submitted: true, team: req.query.team
|
||||
match['leagues.leagueID'] = league if league = req.query['leagues.leagueID']
|
||||
getHistogramData: (req, res, id) ->
|
||||
match = @makeLeaderboardQueryParameters req, id
|
||||
delete match.totalScore
|
||||
project = totalScore: 1, _id: 0
|
||||
league = req.query['leagues.leagueID']
|
||||
project['leagues.leagueID'] = project['leagues.stats.totalScore'] = 1 if league
|
||||
aggregate = Session.aggregate [
|
||||
{$match: match}
|
||||
|
|
Loading…
Reference in a new issue