i tried something like this in rails with mongoid 3.1.0 and lastest 3.1.3. .limit does not work. below it should return 1 row but it returns all (4)
code:
The limit command works fine, but for some reason count ignores the limit. If you cast it to an array you'll see that the limit is working.
limit
count
Array(Gallery.limit(1)).length # this gives 1
Also, if you actually iterate through the objects you'll see that the limit is working.