[bug?] update_all lost data when using with $addToSet #5674
Replies: 3 comments
-
Digging further, the problem is in The workaround exists by omitting the type of the field. field :list, type: :array, default: [] To this: field :list, default: [] Probably |
Beta Was this translation helpful? Give feedback.
-
Thank you for reporting this! I don't know how your post got past our radar, but I apologize for missing this. I've added a ticket to our tracking system here, if you'd like to follow along: https://jira.mongodb.org/browse/MONGOID-5686 |
Beta Was this translation helpful? Give feedback.
-
Since the issue was fixed, I am closing this discussion. @midnight-wonderer thank you again for reporting this! |
Beta Was this translation helpful? Give feedback.
-
$addToSet
is weird.Here is the model:
Create one element:
Add something to the set:
Reload:
Expecting:
['a']
Actual:
[nil]
Why?
Beta Was this translation helpful? Give feedback.
All reactions