DynamoDB:包含所有过滤器 [英] DynamoDB: Contains all filter

查看:101
本文介绍了DynamoDB:包含所有过滤器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个模式,该模式的字段名为 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:包含所有过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆