Closed yutongp closed 7 months ago
This issue is stale because it has been open 30 days with no activity.
Hi @yutongp , Sorry for the late reply. I'll fix it during the next bug-fixing session. Thank you for the catch
Hi @yutongp ,
This is a VERY weird bug. Thank you for the catch!
The problem is with the $set
operator of MongoDB. It looks like it doesn't like dots.
You can reproduce it with:
await data.update({"$set": {"https://www.google.com/foo": "worlds"}})
I'd suggest applying a function to not include dots to keys. Like this:
key = "https://www.google.com/foo".replace(".", "%2E")
data = await Data(data={key: "bar"}).save()
data.data = {key: "world"}
await data.save_changes()
This issue is stale because it has been open 30 days with no activity.
This issue was closed because it has been stalled for 14 days with no activity.
Describe the bug save_changes doesn't save data correctly when data is a dictionary and the key has "." in it's value
To Reproduce
Expected behavior A clear and concise description of what you expected to happen. Data should be stored as
However, beanie split the
https://www.google.com/hello
into nested level object and stored the data asAdditional context Add any other context about the problem here.