mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -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:
|
async for doc in cursor:
|
||||||
pkeys = doc["_id"]["RED_primary_key"]
|
pkeys = doc["_id"]["RED_primary_key"]
|
||||||
del doc["_id"]
|
del doc["_id"]
|
||||||
if len(pkeys) == 1:
|
if len(pkeys) == 0:
|
||||||
# Global data
|
# Global data
|
||||||
ret.update(**doc)
|
ret.update(**doc)
|
||||||
elif len(pkeys) > 1:
|
elif len(pkeys) > 0:
|
||||||
# All other data
|
# All other data
|
||||||
partial = ret
|
partial = ret
|
||||||
for key in pkeys[:-1]:
|
for key in pkeys[:-1]:
|
||||||
@ -103,8 +103,6 @@ class Mongo(BaseDriver):
|
|||||||
partial.update(**doc)
|
partial.update(**doc)
|
||||||
else:
|
else:
|
||||||
partial[pkeys[-1]] = doc
|
partial[pkeys[-1]] = doc
|
||||||
else:
|
|
||||||
raise RuntimeError("This should not happen.")
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
async def get(self, identifier_data: IdentifierData):
|
async def get(self, identifier_data: IdentifierData):
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user