mirror of
https://github.com/Jylpah/blitz-tools.git
synced 2026-10-21 10:17:05 +02:00
get_db_player_stats(): Fix aggregation
This commit is contained in:
1 parent
763f205175
commit
67aeaddf36
1 file changed
+1
-1
@@ -2145,7 +2145,7 @@ async def get_db_player_stats(db : motor.motor_asyncio.AsyncIOMotorDatabase, sta
|
|||||||
|
|
||||||
pipeline = [ { '$match': { '$and': [ { 'account_id': account_id }, { 'last_battle_time': { '$lte': battletime + time_buffer }} ]}},
|
pipeline = [ { '$match': { '$and': [ { 'account_id': account_id }, { 'last_battle_time': { '$lte': battletime + time_buffer }} ]}},
|
||||||
{ '$sort': { 'last_battle_time': -1 }},
|
{ '$sort': { 'last_battle_time': -1 }},
|
||||||
{ '$group': { '_id': '$tank_id', 'doc': { '$first': '$$ROOT' }}},
|
{ '$group': { '_id': { 'tank_id':'$tank_id'}, 'doc': { '$first': '$$ROOT' }}},
|
||||||
{ '$replaceRoot': { 'newRoot': '$doc' }},
|
{ '$replaceRoot': { 'newRoot': '$doc' }},
|
||||||
{ '$project': { '_id': 0 }} ]
|
{ '$project': { '_id': 0 }} ]
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user