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

Calling any Enumerable method on mongo context exhausts query

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.1.6, 6.0.3
    • Affects Version/s: 5.1.5
    • Component/s: None
    • None

      If you have a huge collection, with maybe 1,000,000 documents in it, and you call, for example, Document.unscoped.any?, the whole collection will be loaded in memory.

      The main reason why I see this as a bug, is that the issue is not present in 5.1.4. I am not sure what exactly happens, but 5.1.4 will instantly return with the correct value. Unfortunately, it is not the case anymore with 5.1.5.

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            sylvain-8422 Sylvain Bernier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: