mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: sorted some queries results (champions/mates)
This commit is contained in:
parent
788f733c96
commit
897055b189
1 changed files with 4 additions and 3 deletions
|
|
@ -74,7 +74,7 @@ class MatchRepository {
|
||||||
assists: { $sum: '$stats.assists' },
|
assists: { $sum: '$stats.assists' },
|
||||||
}
|
}
|
||||||
const finalSteps = [
|
const finalSteps = [
|
||||||
{ $sort: { 'count': -1 } },
|
{ $sort: { 'count': -1, 'champion.name': 1 } },
|
||||||
{ $limit: limit }
|
{ $limit: limit }
|
||||||
]
|
]
|
||||||
return this._aggregate(puuid, {}, [], '$champion.id', groupParams, finalSteps)
|
return this._aggregate(puuid, {}, [], '$champion.id', groupParams, finalSteps)
|
||||||
|
|
@ -117,7 +117,7 @@ class MatchRepository {
|
||||||
kp: { $avg: '$stats.kp' },
|
kp: { $avg: '$stats.kp' },
|
||||||
}
|
}
|
||||||
const finalSteps = [
|
const finalSteps = [
|
||||||
{ $sort: { 'count': -1 } }
|
{ $sort: { 'count': -1, 'champion.name': 1 } }
|
||||||
]
|
]
|
||||||
return this._aggregate(puuid, matchParams, [], '$champion.id', groupParams, finalSteps)
|
return this._aggregate(puuid, matchParams, [], '$champion.id', groupParams, finalSteps)
|
||||||
}
|
}
|
||||||
|
|
@ -263,6 +263,7 @@ class MatchRepository {
|
||||||
*/
|
*/
|
||||||
mates(puuid) {
|
mates(puuid) {
|
||||||
const intermediateSteps = [
|
const intermediateSteps = [
|
||||||
|
{ $sort: { 'gameId': -1 } },
|
||||||
{ $unwind: '$allyTeam' },
|
{ $unwind: '$allyTeam' },
|
||||||
]
|
]
|
||||||
const groupParams = {
|
const groupParams = {
|
||||||
|
|
@ -282,7 +283,7 @@ class MatchRepository {
|
||||||
'count': { $gte: 2 }
|
'count': { $gte: 2 }
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{ $sort: { 'count': -1 } },
|
{ $sort: { 'count': -1, 'name': 1 } },
|
||||||
{ $limit: 15 },
|
{ $limit: 15 },
|
||||||
]
|
]
|
||||||
return this._aggregate(puuid, {}, intermediateSteps, '$allyTeam.account_id', groupParams, finalSteps)
|
return this._aggregate(puuid, {}, intermediateSteps, '$allyTeam.account_id', groupParams, finalSteps)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue