-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Query
-
-
Minor Change
I found myself on the console today trying to debug an issue by looking at mongoid documents:
$ items.find { |item| item["uuid"] == "1234" } => nil $ items.select { |item| item["uuid"] == "1234" }.any? => true
In this case, `items` is an instance of `Mongoid::Criteria`, and the `find` being executed was `Mongoid::Criteria::Findable#find`, rather than the `Enumerable#find` which I expected. (Items is defined in another method, in another file, elsewhere, so I had forgotten it was a `Mongoid::Criteria` rather than simply an Enumerable)
I propose that we add a `Mongoid::Criteria#find` which routes to the appropriate find method based on the passed arguments
- is related to
-
MONGOID-5003 Delegate Model#find with block argument to Enumerable#find
- Closed
- links to