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

Insufficient testing for limit functionality

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 7.2.0.rc1, 7.1.4, 7.0.10, 6.4.7
    • None
    • None

    Description

      Currently, Mongoid's tests for QueryCache functionality when queries with different limits are executed are insufficient, since the collections are empty and therefore don't test if the correct amount of documents are being returned if the cache is used. 

      I don't believe the functionality is correct because in the case shown below, when the cache is used all of the stored cached_documents will still be iterated, not a limited subset of them. The QueryCache in driver should return the correct documents. 

      It is my understanding that the code on lines 250-252 of the cached_cursor method are unnecessary and should be removed, similar to the driver's implementation.

      Attachments

        1. mongoid tests.png
          mongoid tests.png
          120 kB
        2. cached_cursor method.png
          cached_cursor method.png
          101 kB

        Activity

          People

            emily.giurleo@mongodb.com Emily Giurleo (Inactive)
            grace.chong@mongodb.com Grace Chong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: