Why does limit still return the entire document set in Mongoid?
This seems to be causing my queries to be slow, and I'm 开发者_运维百科confused as to why it is returning all entries of the document.
>> Product.skip(0).limit(20).count
=> 3826
Thats the behaviour of the count(), which returns the count of the records the query touched
You need to use size() to count the current set.
精彩评论