Filter and sort
Query Language
Endpoints that allow querying follow these format guidelines.
Query Products
Fields That Allow Filtering
Field | Operators | Sorting Allowed |
---|---|---|
name | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
description | $eq,$ne,$hasSome,$contains,$startsWith | |
sku | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
id | $eq,$ne,$hasSome | Allowed |
price | $eq,$ne,$hasSome,$lt,$lte,$gt,$gte | Allowed |
numericId | $eq,$ne,$hasSome,$lt,$lte,$gt,$gte | Allowed |
productType | $eq,$ne,$hasSome | Allowed |
slug | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
collections.id | $eq,$ne,$hasSome,$hasAll | |
options.<option name> | $eq,$ne,$hasSome,$hasAll | |
inventoryStatus | $eq,$ne,$hasSome | |
lastUpdated | $eq,$ne,$hasSome,$lt,$lte,$gt,$gte | Allowed |
createdDate | $eq,$ne,$hasSome,$lt,$lte,$gt,$gte | Allowed |
** Note that "HasSome" is same as the operator "IN" in SQL
Examples
Query products where price = 10
Copy
1
Query products, order by price descending
Copy
1
Getting all products for a given collection
Copy
1
Getting multiple products by IDs
Copy
1
Getting all products with a specific choice
Copy
1
Getting all products in a store
- Get the first page:
Copy
1
- Take the numericId of the last returned item and run the following query:
Copy
1
- Continue until no more records are returned.
Query Collections
Fields That Allow Filtering
Field | Operators | Sorting Allowed |
---|---|---|
name | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
id | $eq,$ne,$hasSome,$contains,$startsWith | Allowed |
** Note that "HasSome" is same as the operator "IN" in SQL
Examples
Query collections where name = my collection
Copy
1
Was this helpful?
Yes
No