Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parsing of $or and $and conditions #1031

Closed
ivansenic opened this issue Jun 17, 2021 · 0 comments
Closed

Support parsing of $or and $and conditions #1031

ivansenic opened this issue Jun 17, 2021 · 0 comments
Assignees

Comments

@ivansenic
Copy link
Contributor

ivansenic commented Jun 17, 2021

As the first step towards the $or in the document service, we should support the parsing of the $or. The $or should have a array JSON value with one or more conditions.

We should also explicitly support the $and, although we already do support it as all the condition in the same JSON object level would be wrapped in the and.

Example:

{
   "fixed":{
      "$eq":1
   },
   "$or":[
      {
         "one":{
            "$eq":1
         }
      },
      {
         "two":{
            "$eq":2
         }
      },
      {
         "$and":[
            {
               "three":{
                  "$eq":3
               }
            },
            {
               "four":{
                  "$eq":4
               }
            }
         ]
      }
   ]
}

should resolve as AND(fixed=1, OR(one=1, two=2, AND(three=4, four=4)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant