dev-master 2017-08-17 16:33 UTC

This package is not auto-updated.

Last update: 2024-05-11 17:18:06 UTC


README

JQL - Json Query Language

JQL is a json query language.

A single query looks like:

{
  "field": "model.fieldname",
  "operator": "lt",
  "value": "value"
}

Operators

  • lt = <,
  • gt = >,
  • lte = <=,
  • gte = >=,
  • eq = =,
  • ne = !=,
  • beginswith
  • endswith
  • contains
  • in

Example:

{
  "jql": [
    {
      "field": "mammals.A",
      "operator": "in",
      "value": ["A", "B", "C"]
    },
    {
      "field": "mammals.B",
      "operator": "eq",
      "value": "false"
    },
    {
      "OR": [
        {
          "field": "birds.C",
          "operator": "eq",
          "value": "true"
        },
        {
          "field": "mammals.D",
          "operator": "eq",
          "value": "true"
        },
        {
          "field": "mammals.E",
          "operator": "eq",
          "value": "true"
        },
        {
          "OR": [
            {
              "field": "dogs.F",
              "operator": "eq",
              "value": "true"
            },
            {
              "field": "dogs.G",
              "operator": "eq",
              "value": "true"
            },
            [
              {
                "field": "cats.H",
                "operator": "eq",
                "value": "true"
              },
              {
                "field": "cats.I",
                "operator": "eq",
                "value": "true"
              }
            ]
          ]
        }
      ]
    },
    {
      "field": "dogs.J",
      "operator": "eq",
      "value": "true"
    }
  ]
}

Requirements

  • PHP >=5.5

Contributing

Contributions to the JQL package are welcome. Please note the following guidelines before submiting your pull request.

  • Follow PSR-2 coding standards.
  • Write tests for new functions and added features

License

Canopy/JQL is licensed under the MIT License.