ruby on rails - Why does limit still return the entire document set in Mongoid? -


this seems causing queries slow, , i'm confused why returning entries of document.

>> product.skip(0).limit(20).count => 3826 

thats behaviour of count(), returns count of records query touched

you need use size() count current set.


Comments

Popular posts from this blog

Python __call__ special method practical example -

arrays - jQuery - Retrieve values from HTML elements and return their sum -