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

.count returns total document count

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

      This is related to issue:

      https://github.com/mongoid/mongoid/issues/1584

      When I limit a query and then do a count on the query the count always returns the total number of documents and not the limit amount.

      For example if I have 211 people documents and do People.limit(20).count I will get 211 as the count. The issue about says I can pass true to count, but that results in:

      NoMethodError: undefined method `id' for true:TrueClass

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

              Created:
              Updated:
              Resolved: