Skip to content

Add static method to create OR criterion. #3884

@christophstrobl

Description

@christophstrobl

Currently the only way to create an $or only query is counter intuitive and leads people to creating $and combined criterions to a single element $or as outlined below.

query(where("title").is(...).orOperator(where("content").is(...))
{
  "title": ...,
  "$or": [
    {
      "content": ...
    }
  ]
}

The correct, rather cumbersome usage would be as follows:

query(new Criteria().orOperator(where("title").is(...), where("content").is(...)))

Introducing a static or(Critieria... criterions) method would allow for simpler usage

query(or(where("title").is(...), where("content").is(...)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions