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

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

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 3.1.3
    • Component/s: None
    • Labels:
      None

      Description

      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?

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: