mongoid .limit does not work in mongoid 3.1.x

前端 未结 3 1592
我在风中等你
我在风中等你 2021-02-19 18:17

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:



        
3条回答
  •  感动是毒
    2021-02-19 19:07

    As suggested in the official Mongoid answer, we should be using Gallery.limit(1).count(true)

提交回复
热议问题