Skip to content

Mim: $ne with array #10

Description

@brondsem

Mim does not match mongodb's behavior concerning matching sub-lists with $ne when the field is an empty list.

    self.bind.db.coll.insert(
        {'_id':'foo', 'hist': [{'int': 2}]}
    )
    self.bind.db.coll.insert(
        {'_id':'foo2', 'hist': []}
    )
    self.bind.db.coll.insert(
        {'_id':'foo3'}
    )
    self.bind.db.coll.insert(
        {'_id':'foo4', 'hist': [{'foo': 'bar'}]}
    )

    objs = self.coll.find({'hist.int': {'$ne': 5235}}).all()
    # this returns foo, foo3, foo4 but should also return foo2

Note https://docs.mongodb.com/manual/reference/operator/query/ne/index.html doesn't specify behavior for empty lists, but we should match how mongodb actually works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions