databasecassandradatastaxdatastax-astrastargate-oss

Rest API Cassandra ALLOW FILTERING


I have a DataStax Astra database and I have this example for how to get a user with a specific username:

curl --request GET \
    --url https://${ASTRA_DB_ID}-${ASTRA_DB_REGION}.apps.astra.datastax.com/api/rest/v2/keyspaces/${ASTRA_DB_KEYSPACE}/user?where=\{"user_username":\{"$eq":"'+*username_value_here*+'"\}\}' \
    --header "x-cassandra-token: ${ASTRA_DB_APPLICATION_TOKEN}"

And because of Cassandra i don't have the option ALLOW FILTERING:

{"description":"Bad request: org.apache.cassandra.stargate.exceptions.InvalidRequestException: Cannot execute this query as it might involve data filtering and thus may have unpredictable performance. If you want to execute this query despite the performance unpredictability, use ALLOW FILTERING","code":400}

I can't find anywhere how to enable this option in curl command, so the question is how can i write this (if it's possible) or there are better alternatives. Any help is welcomed.


Solution

  • The REST API does not currently support ALLOW FILTERING but you have some other options.