我有一个DataStax天文数据库,我有一个如何获得具有特定用户名的用户的示例:
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}"因为卡桑德拉,我没有允许过滤的选项:
{"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}我在哪里都找不到如何在curl命令中启用这个选项,所以问题是我如何编写这个选项(如果可能的话),或者有更好的替代方法。欢迎任何帮助。
发布于 2021-11-29 00:26:08
REST目前不支持ALLOW FILTERING,但您还有其他一些选项。
user_username作为分区键。这将允许您在不需要filtering.user_username上添加索引。索引将使您能够维护现有的访问模式,同时还允许您使用用户名.进行查询。
https://stackoverflow.com/questions/70145901
复制相似问题