ListOptions interface, supporting complex filters, sorting, pagination, and column selection.
Basic Query with Pagination
Retrieve entries with pagination and sorting.Simple Filter
Filter entries using exact match conditions.Object Notation
Null Values
Advanced Filters
Use the array filter syntax for complex operations.Comparison Operators
Equality Operators
Between Operator
Empty Checks
List Membership
String Contains
Array Operations
Combining Filters (AND Logic)
Combine multiple filters with AND logic.OR Filters
UseorFilter for conditions where any can be true.
Combining AND and OR Filters
Use bothfilter and orFilter together.
Nested OR/AND within Filters
Create complex nested conditions within a single filter.Column Selection
Optimize queries by selecting only needed columns.Column selection can significantly improve performance for large datasets by reducing the amount of data transferred.
Sorting
Sort results by any field.Pagination
Implement efficient pagination for large datasets.Complete Filtering Example
Here’s a comprehensive example showing advanced filtering:Filter Type Reference
Complete type definitions for filters:List Options Interface
Best Practices
Use Column Selection
Only request columns you need to reduce data transfer and improve performance.
Index Sort Fields
Ensure database fields used in
orderBy are indexed for optimal performance.Limit Results
Always use
limit to avoid fetching excessive data. Implement pagination for large datasets.Filter Early
Apply filters on the server side rather than fetching all data and filtering client-side.
Performance Tips
Use simple filters when possible
Object notation filters (
{ status: 'active' }) are simpler and often faster than array filters.Combine filters efficiently
Use
filter for AND conditions and orFilter for OR conditions instead of complex nested structures.Paginate large results
Always use
limit and offset for large datasets to avoid memory issues and improve load times.