Skip to main content

Filter Operators

Filters are passed as query parameters using the format:

?<column>=<operator>.<value>

For example, to get users with id greater than 5:

GET /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=gt.5&pg=0&ps=10

Filters work on GET, PUT, and DELETE. POST does not support filters — it always inserts new rows.


Supported Operators

Comparison

OperatorMeaningExample
eqEqualsid=eq.10
neNot equalsid=ne.10
ltLess thanid=lt.100
gtGreater thanid=gt.5
leLess than or equalid=le.50
geGreater than or equalid=ge.10

Range

OperatorMeaningExample
bwBetween (inclusive)id=bw.10.20

String Pattern

OperatorMeaningExample
liLIKE %value% — containsname=li.alice
rliLIKE value% — starts withname=rli.ali
nliNOT LIKE %value% — does not containname=nli.admin
ilILIKE %value% — contains, case-insensitivename=il.ALICE
Not Supported

lli (left LIKE) is not supported. The API returns 417 if used.

Set

OperatorMeaningExample
inValue is in listid=in.6,7,8
ninValue is not in listid=nin.1,2,3
note

Do not use parentheses for in / nin. Correct: id=in.6,7,8 — not id=in.(6,7,8).

Unsupported Operators

OperatorStatus
is (IS NULL)❌ Not supported — returns 417
lli (left LIKE)❌ Not supported — returns 417
Any unknown operator❌ Returns 417

Combining Multiple Filters

Pass multiple filter params in the same request. All filters are combined with AND:

GET /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=gt.5&is_active=eq.1&pg=0&ps=10

Returns only users where id > 5 AND is_active = 1.


Try It — GET with Filters

Use the query params box to try any filter. Examples to paste in:

  • id=gt.5&pg=0&ps=10
  • id=bw.10.20&pg=0&ps=20
  • id=in.6,7,8&pg=0&ps=10
  • name=li.alice&pg=0&ps=10
  • id=nin.1,2,3&pg=0&ps=20
GEThttps://demo.littlebit.in:443/minimal/api/rest/auto/v1/btec/tst/ms//
📋 Schema — demo_db.users
-- demo_db.users schema
CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  email VARCHAR(100) NOT NULL UNIQUE,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB;
curl --location 'https://demo.littlebit.in:443/minimal/api/rest/auto/v1/btec/tst/ms/demo_db/users?pg=0&ps=10' \
  --header 'X-Org-Id: 01KKBPGAE4CR13W14E4T4ACSAB' \
  --header 'X-Project-Id: 01KF6G55AK87WWGQ145SDA2AC9' \
  --header 'X-Space-Id: 01KF6G55AK87WWGQ145SDA25X9' \
  --header 'X-User-Id: 01KBY3K9NDC5XW523M2V1Z0373' \
  --header 'X-User-Roles: users, admin'
// Hit "Send GET" to see the live response

Try It — PUT with Filters

Filter selects which row(s) to update. Use the query params box for the filter and the body box for the new values. Example query param:

  • id=eq.10
PUThttps://demo.littlebit.in:443/minimal/api/rest/auto/v1/btec/tst/ms//
📋 Schema — demo_db.users
-- demo_db.users schema
CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  email VARCHAR(100) NOT NULL UNIQUE,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB;
curl --location 'https://demo.littlebit.in:443/minimal/api/rest/auto/v1/btec/tst/ms/demo_db/users?id=eq.1&set=name.Steve%20Cat%2033%20Steve%20Cat%2034' \
  --header 'X-Org-Id: 01KKBPGAE4CR13W14E4T4ACSAB' \
  --header 'X-Project-Id: 01KF6G55AK87WWGQ145SDA2AC9' \
  --header 'X-Space-Id: 01KF6G55AK87WWGQ145SDA25X9' \
  --header 'X-User-Id: 01KBY3K9NDC5XW523M2V1Z0373' \
  --header 'X-User-Roles: users, admin'
// Hit "Send PUT" to see the live response

Try It — DELETE with Filters

Filter selects which row(s) to delete. Example query param:

  • id=eq.10
danger

Always use a precise filter with DELETE. A missing or overly broad filter may delete all rows in the table.

DELETEhttps://demo.littlebit.in:443/minimal/api/rest/auto/v1/btec/tst/ms//
📋 Schema — demo_db.users
-- demo_db.users schema
CREATE TABLE users (
  id INT AUTO_INCREMENT PRIMARY KEY,
  name VARCHAR(100) NOT NULL,
  email VARCHAR(100) NOT NULL UNIQUE,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB;
curl --location 'https://demo.littlebit.in:443/minimal/api/rest/auto/v1/btec/tst/ms/demo_db/users?id=eq.10' \
  --header 'X-Org-Id: 01KKBPGAE4CR13W14E4T4ACSAB' \
  --header 'X-Project-Id: 01KF6G55AK87WWGQ145SDA2AC9' \
  --header 'X-Space-Id: 01KF6G55AK87WWGQ145SDA25X9' \
  --header 'X-User-Id: 01KBY3K9NDC5XW523M2V1Z0373' \
  --header 'X-User-Roles: users, admin'
// Hit "Send DELETE" to see the live response

Pagination is Always Required

Filters do not remove the pagination requirement. Every GET request must include pg and ps:

GET /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=gt.5&pg=0&ps=10

Omitting pg / ps returns 406 Not Acceptable.


Real-World Examples

Find users by email domain:

GET /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?email=li.@example.com&pg=0&ps=50

Find usernames starting with a prefix:

GET /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?name=rli.ali&pg=0&ps=20

Get a specific ID range:

GET /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=bw.10.20&pg=0&ps=50

Exclude a set of IDs:

GET /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=nin.1,2,3,4,5&pg=0&ps=20

Active users with high IDs:

GET /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=gt.5&is_active=eq.1&pg=0&ps=20

Update a single row by ID:

PUT /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=eq.10

Delete a single row by ID:

DELETE /minimal/api/rest/auto/v1/acme/demo/ms/demo_db/users?id=eq.10

Error Reference

CodeCause
406pg or ps missing from GET request
417Unknown or unsupported filter operator used
400Filter value type does not match column type