开发者

Why does limit still return the entire document set in Mongoid?

开发者 https://www.devze.com 2023-04-12 07:41 出处:网络
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.

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

精彩评论

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

关注公众号