Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-2927

Limit and count don't work together, unless defining lazy

    • Type: Icon: Task Task
    • Resolution: Done
    • 3.1.3
    • Affects Version/s: None
    • Component/s: None
    • None

      I'm trying to get 5 items from my db
      Shop::CartItems.limit(5).count #=> 21

      It only returns 5 if I say lazy
      Shop::CartItems.limit(5).lazy.count #=> 5

      I read something about count taking on a boolean, but I couldn't get that to work and I didn't find anything in the docs either.

      Should this work like this? Am I doing something wrong?

            Assignee:
            Unassigned Unassigned
            Reporter:
            deiga deiga
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: