Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Fixed
-
None
-
None
Description
It is an edge case but when slicing a cursor with for instance [1:1], cloning the cursor would lead to a different result (initial cursor would be empty, cloned cursor won't be empty)
collection.count()
|
cursor1 = collection.find()[1:1] |
|
assert cursor1._Cursor__empty is True |
assert cursor1._Cursor__limit == 0 |
assert cursor1._Cursor__skip == 1 |
|
cursor2 = cursor1.clone()
|
assert cursor2._Cursor__empty is True # raises AssertionError, its False |
assert cursor2._Cursor__skip == 1 |
assert cursor2._Cursor__limit == 0 |