开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜