Realtime Cloud Storage

ListFilter

Specification of the filter structure used by the listItems operation.

Properties

String item

Name of an item's attribute to which the filter will be applied. For query operations, this is not required as all filters are applied to the secondary key.

String operator

The comparison operator. Can include one of the following types: 'equals', 'notEquals', 'lessEqual', 'lessThan', 'greaterEqual', 'greaterThan', 'notNull', 'null', 'contains', 'notContains', 'beginsWith', 'in' and 'between'.

String|Number value

Attribute values to be used with a comparison operator. Its type varies according with the operator used (i.e. 'between' requires two values, hence an array).

Sample

/* Below are examples of listItems operation for all of the supported comparison operators. */

// equals
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "equals", "item": "task", "value": "Debug" }] }'

// notEquals
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "notEquals", "item": "task", "value": "Debug" }] }'

// lessEqual
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "lessEqual", "item": "replies", "value": 10 }] }'

// lessThan
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: { "operator": "lessThan", "item": "replies", "value": 10 } }'

// greaterEqual
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "greaterEqual", "item": "replies", "value": 10 }] }'

// greaterThan
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "greaterThan", "item": "replies", "value": 10 }] }'

// notNull
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "notNull", "item": "task" }] }'

// null
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "null", "item": "task" }] }'

// contains
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "contains", "item": "task", "value": "Code" }] }'

// notContains
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "notContains", "item": "task", "value": "Code" }] }'

// beginsWith
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "beginsWith", "item": "task", "value": "Code" }] }'

// in
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "in", "item": "task", "value": "Code" }] }'

// between
curl 'https://storage-backend-prd-useast1.realtime.co/listItems' -H 'Content-Type: application/json; charset=UTF-8' -d '{ "applicationKey":"[YOUR_APP_KEY]", "authenticationToken":"[YOUR_TOKEN]", "table":"SampleUser", filter: [{ "operator": "between", "item": "replies", "value": [0, 5] }] }'