zebzhao / Angular-QueryBuilder

A modernized Angular 4+ query builder based on jquery QueryBuilder
MIT License
292 stars 222 forks source link

Is there a way to only allow rulesets and not individual rules? #246

Open UNADYNE opened 2 years ago

UNADYNE commented 2 years ago

I would like to simplify the data being sent to the backend. I want to avoid any nesting of queries. I would like all queries to be as below.

[
  {
    "condition": "and",
    "rules": [
      { "field": "column", "operator": "=", "value": -1 },
      { "field": "value", "operator": "=", "value": "2" },
      { "field": "then", "operator": "with", "value": "3" }
    ]
  },
  {
    "condition": "and",
    "rules": [
      { "field": "column", "operator": "=", "value": 198 },
      { "field": "value", "operator": "=", "value": "4" },
      { "field": "then", "operator": "with", "value": "5" }
    ]
  }
]