Skip to content

Mindconnect API – Filtering

General

All endpoints with the parameter filter support basic filtering.

Wildcards are not supported. Timestamps must be in ISO-8601 format as follows: YYYY-MM-DDTHH:mm:ss.sssZ, e.g.: 2018-10-04T07:58:49.369Z.

When a filter has no matches, the response will be empty.

Filter functions

Function eq (equals)

1
2
3
{
  "agentId": "3b27818ea09a46b48c7eb3fbd878349f"
}

or

1
2
3
4
5
{
  "agentId": {
    "eq": "3b27818ea09a46b48c7eb3fbd878349f"
  }
}

Function in

The function in is very similar to equals, but instead matching to one value, it checks an array of values, and matches for any of them.

1
2
3
4
5
6
7
{
    "agentId": {
        "in": {
            "value": ["3b27818ea09a46b48c7eb3fbd878349f", "9b27818ea09a46b48c7eb3fbd878349f"]
        }
    }
}

or

1
2
3
4
5
{
    "agentId": {
        "in": ["3b27818ea09a46b48c7eb3fbd878349f", "9b27818ea09a46b48c7eb3fbd878349f"]
        }
}

Function endsWith

1
2
3
4
5
{
    "message": {
        "endsWith": "Successful."
    }
}

Function startsWith

1
2
3
4
5
{
    "message": {
        "startsWith": "Dropped"
    }
}

Function contains

1
2
3
4
5
{
    "message": {
        "contains": "Timeseries"
    }
}

Function before

1
2
3
4
5
{
    "timestamp": {
        "before": "2018-01-01T00:00:00.00Z"
    }
}

Function after

1
2
3
4
5
{
    "timestamp": {
        "after": "2018-01-01T00:00:00.00Z"
    }
}

Function between

Checks if the value of the field is between the given range

Parentheses for inclusive date: [] Parentheses for exclusive date: ()

1
2
3
4
5
{
    "timestamp": {
        "between": "[2018-01-01T00:00:00.00Z, 2018-01-31T00:00:00.00Z)"
    }
}

Filter operations

Operation not

1
2
3
4
5
6
7
{
  "not": {
      "message": {
        "startsWith": "Accepted"
      }
  }
}

or

1
2
3
4
5
{
  "not": {
    "message":"Accepted"
    }
}

Operation or

1
2
3
4
5
6
7
8
{
    "message": {
        "or": [
            {"eq": "Data is Accepted"},
            {"endsWith": "Accepted"}
        ]
    }
}

or

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "or": {
        "message": {
            "eq": null
        },
        "agentId": {
            "startsWith": "3b27818ea09a46b48c7eb3fbd878349f"
        }
    }
}

Operation and

1
2
3
4
{
    "agentId":"3b27818ea09a46b48c7eb3fbd878349f",
    "message": null
}

or

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
{
    "and":{
      "message": {
          "eq": null
      },
      "agentId": {
          "startsWith": "3b27818ea09a46b48c7eb3fbd878349f"
      }
   }
}

Any questions left?

Ask the community


Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.