mongo_odm
mongo_odm copied to clipboard
MongoODM::Criteria delegates count to Collection instead of Cursor
It seems to me that MongoODM::Criteria
delegates count
method to Collection
instead of Cursor
in method_missing
. The following code
User.find({ :active => true }).count
should return number of active users but returns count of documents in the collection instead.
Sounds logical. I will check it and fix it. Thanks!
I fixed this a while back in my fork, here: https://github.com/CodeMonkeySteve/mongo_odm/commit/f4a55fef6522f94feb50024192883fd4e74c7b48
Feel free to cherry-pick it.