Retrieve documents with filters

Retrieve documents with filters.
Cursor is provided to retrieve even more documents. Loop through it to retrieve all documents in the database.
Filter is used to retrieve documents that match the conditions set in a filter query. This is used in advance search to filter the documents that are searched.

The filters query is a json body that follows the schema of:

[
    {'field' : <field to filter>, 'filter_type' : <type of filter>, "condition":"==", "condition_value":"america"},
    {'field' : <field to filter>, 'filter_type' : <type of filter>, "condition":">=", "condition_value":90},
]

These are the available filter_type types: ["contains", "category", "categories", "exists", "date", "numeric", "ids"]

  1. "contains": for filtering documents that contains a string.
    {'field' : 'item_brand', 'filter_type' : 'contains', "condition":"==", "condition_value": "samsu"}
  2. "exact_match"/"category": for filtering documents that matches a string or list of strings exactly.
    {'field' : 'item_brand', 'filter_type' : 'category', "condition":"==", "condition_value": "sumsung"}
  3. "categories": for filtering documents that contains any of a category from a list of categories.
    {'field' : 'item_category_tags', 'filter_type' : 'categories', "condition":"==", "condition_value": ["tv", "smart", "bluetooth_compatible"]}
  4. "exists": for filtering documents that contains a field.
    {'field' : 'purchased', 'filter_type' : 'exists', "condition":"==", "condition_value":" "}
    If you are looking to filter for documents where a field doesn't exist, run this:
    {'field' : 'purchased', 'filter_type' : 'exists', "condition":"!=", "condition_value":" "}
  5. "date": for filtering date by date range.
    {'field' : 'insertdate', 'filter_type' : 'date', "condition":">=", "condition_value":"2020-01-01"}
  6. "numeric": for filtering by numeric range.
    {'field' : 'price', 'filter_type' : 'numeric', "condition":">=", "condition_value":90}
  7. "ids": for filtering by document ids.
    {'field' : 'ids', 'filter_type' : 'ids', "condition":"==", "condition_value":["1", "10"]}

These are the available conditions:

"==", "!=", ">=", ">", "<", "<="

If you are looking to combine your filters with multiple ORs, simply add the following inside the query
{"strict":"must_or"}.

For pagination support refer to /datasets/{dataset_id}/documents/paginate.

Language
Click Try It! to start a request and see the response here!