Skip to content

Invalid QuerySet count caching  #1602

@wojcikstefan

Description

@wojcikstefan

Steps to reproduce:

class User(Document):
    name = StringField()

User.drop_collection()
User.objects.create(name='aaa')
User.objects.create(name='bbb')
User.objects.create(name='ccc')
qs = User.objects
print qs.count(with_limit_and_skip=True)  # 3
User.objects.create(name='ddd')
print qs.count(with_limit_and_skip=True)  # still 3 :(

Expected behavior: the 2nd count returns 4.
Actual behavior: the 2nd count returns 3, because the query set's previous count result is cached.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions