-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
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.