mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[V3 Mongo] Correct dictionary rebuilding process for global all case (#2581)
This commit is contained in:
parent
8b3c3e89e9
commit
0652dd344b
@ -87,10 +87,10 @@ class Mongo(BaseDriver):
|
||||
async for doc in cursor:
|
||||
pkeys = doc["_id"]["RED_primary_key"]
|
||||
del doc["_id"]
|
||||
if len(pkeys) == 1:
|
||||
if len(pkeys) == 0:
|
||||
# Global data
|
||||
ret.update(**doc)
|
||||
elif len(pkeys) > 1:
|
||||
elif len(pkeys) > 0:
|
||||
# All other data
|
||||
partial = ret
|
||||
for key in pkeys[:-1]:
|
||||
@ -103,8 +103,6 @@ class Mongo(BaseDriver):
|
||||
partial.update(**doc)
|
||||
else:
|
||||
partial[pkeys[-1]] = doc
|
||||
else:
|
||||
raise RuntimeError("This should not happen.")
|
||||
return ret
|
||||
|
||||
async def get(self, identifier_data: IdentifierData):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user