Skip to content

Searching on undefined model values #18

@dupski

Description

@dupski

How do we query for these?
in MongoDB there is a $exists: false operator and in SQL we'd do WHERE value = NULL

Proposal:

We add a _set operator for field criteria

e.g.

where: {
  _or: [
    { published: false },
    { published: { _set: false }}
  ]
}

In mongodb (and JS), there is undefined as well as null. My feeling is _set: false should match both undefined and null values since in most SQL databases, undefined == null.

The above criteria can then be used for the BooleanSearchField (currently it only matches records which are specifically set to false)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions