"count" takes a very long time
Hello,
I just noticed (thanks to my growing base!) that for a given Item < Mongomatic::Base, Item.count will take a long time (37 seconds in my example). After browsing the code I suspect that count is going through all the documents to count them (count is doing find.count).
Using Item.collection.count instead is very fast.
I'm currently using Mongomatic 0.5.8.
Yep, you should use .collection.count, bugfix will be forthcoming so that .count uses that too.
In the mean time, a simple doc patch is enough if you prefer :)
Thanks for your work on Mongomatic!
@benmyles what was the suggested fix for this?
@jsmestad: looking at the code quickly I believe the fix is still to use .collection.count directly.