Filtering
The Query API allows you to filter the results of your Query Result Set. This is useful if you run a large query and want to retrieve subsets of the results without re-executing the entire query. It can also be useful if you're building a front-end application and want to allow your users to filter the result set without putting pressure on client-side resources.
Filters do NOT re-execute your query. They filter over the existing result set from a query. Due to some engineering ingenuity, these manipulations are able to be executed "on the fly" when requesting your query results.
Let's build on the example from the list section and filter our results to only include the Moonbird NFT project.
Now let's imagine we only want MoonBirds sales greater than $5k USD. We'd add an additional filter using the greater than or equals to filter ('gte').
Note the order of your filters is important, they get applied in the order they are specified.
Let's add one final filter to only include sales that occurred on OpenSea or Blur.
Here is a table of all available filters:
Equals
eq
Not Equals
neq
Greater Than
gt
Greater Than or Equal To
gte
Less Than
lt
Less Than or Equal To
lte
Like
like
In
in
Not In
notIn
In the next section, we'll discuss how you are debited/billed for a query's execution time using the billable metrics, Query Seconds.
Last updated
Was this helpful?