我有一个模式,该模式的字段名为 ids (数字列表)
I have a schema with a field called ids (list of numbers)
如何创建一个 QuerySpec 来过滤包含指定列表的所有值的项目?
How can I create a QuerySpec to filter the items that contains all values of a specified list?
例如:
item 1: ids=[1,2,3] item 2: ids=[1,3,5]我只需要检索项目1 当我按 [1,2]
我正在使用:
querySpec.withFilterExpression(包含(ids,:f1)和contains(ids,:f2))
但是我不知道它是否有效,或者是否有更方便的方法。
But I don't know if it is efficient or if there is a more convenient way to do it.
推荐答案该值不能为SET,MAP或LIST。您必须使用 AND 运算符才能获得OP中提到的结果。
The value cannot be SET, MAP or LIST. You have to use AND operator to achieve the result as mentioned in the OP.
列表支持:在评估 a CONTAINS b时, a 可以是列表;但是, b不能是集合,地图或列表。
CONTAINS is supported for lists: When evaluating "a CONTAINS b", "a" can be a list; however, "b" cannot be a set, a map, or a list.
更多推荐
DynamoDB:包含所有过滤器
发布评论