Skip to content

Issue filtering default booleanΒ #1709

Open
@ghost

Description

I have the exact same issue as #1090 by @moneydance which was closed without an answer.

I have a Django project with a Post model and some documents already in db. Then added the field train = BooleanField(default=False). All of my post documents have now a train field with value False. But Post.objects(train=False) throws zero documents, and Post.objects(train=None) throws all documents, which is not correct.

If I change train values to True and then to False again, then Post.objects(train=False) throws all documents, which is correct (I did this from reading issue #1090), but I shouldn't have to do this in order to make the filtering work correctly.

Django 1.11.7
MongoDB 3.4.10
mongoengine 0.15.0
python 3.5.2

Any help will be appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Model MigrationIssues about Document schema migration

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions