Filtering documents which include the field "brand" in their information.Filtering documents which include the field "brand" in their information.

Filtering documents which include the field "brand" in their information.

exists

This filter returns entries in a database if a certain field (as opposed to the field values in previously mentioned filter types) exists or doesn't exist in them. For instance, filtering out documents in which there is no field 'purchase-info'. Note that this filter is case-sensitive.

from relevanceai import Client 
client = Client()

filter =  [{'field' : 'brand',    # field to look at
            'filter_type' : 'exists', 
            "condition":"==", 
            "condition_value":""}] 
filtered_data = client.datasets.documents.get_where(dataset_id, filter)

Did this page help you?