From 7.4 to 7.5 *** KeyError Exception: key not found: :id_sort #5520
Unanswered
robinmonjo
asked this question in
Q&A
Replies: 2 comments 3 replies
-
Hi @robinmonjo, it seems |
Beta Was this translation helpful? Give feedback.
2 replies
-
@robinmonjo I've opened MONGOID-5546 for our team to investigate this further. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all,
I'm upgrading mongoid and I face a strange issue. All call to
criteria.find
that uses to work fine on 7.4 stopped working with this error:Tracking down the issue it happens here https://github.com/mongodb/mongoid/blob/7.5-stable/lib/mongoid/contextual/mongo.rb#L272 in the find function.
Here we have:
For me, limit_or_opts is
{}
. Performinglimit_or_opts.try(:fetch, :id_sort)
trigger the error (ruby 2.7 and 3).Changing this code to:
limit_or_opts.try(:[], :id_sort) == :none
would fix this error.What can I do ?
Edit
Seems that for some reasons my call to find inject an empty hash as parameters (I'll have to track that down I don't know where it's coming from). But the issue can be reproduced with this small example:
Beta Was this translation helpful? Give feedback.
All reactions