简体   繁体   English

基于数组中所有元素的 DynamoDB/Dynamoose 查询

[英]DynamoDB/Dynamoose query based on ALL elements in an array

Is there any way using DynamoDB/Dynamoose to query based on an array field containing all of the specified elements?有没有办法使用 DynamoDB/Dynamoose 根据包含所有指定元素的数组字段进行查询? I'm making the move from MongoDB/Mongoose and I need something similar to the functionality of the $all operator in MongoDB ( https://docs.mongodb.com/manual/reference/operator/query/all/ )我正在从 MongoDB/Mongoose 迁移,我需要类似于 MongoDB 中$all运算符的功能( https://docs.Z685A5F7CC75B4796F6C6E00CCD384F01/query/all.com/

No, there is no such feature.不,没有这样的功能。

In any case, you are talking about a FilterExpression parameter to Query here, not a KeyConditionExpression (which can only be about the key columns, and those cannot have nested arrays), so you will pay for the entire items anyway - So you might as well just read the entire items and do the comparisons you want in the client.无论如何,您在这里谈论的是QueryFilterExpression参数,而不是KeyConditionExpression (它只能是关于键列,并且不能有嵌套数组),所以无论如何您都将为整个项目付费 - 所以您可能会好吧,只需阅读整个项目并在客户端中进行您想要的比较。 This will cost you extra in network bandwidth, but not in DynamoDB operations for which you'll pay in any case.这将花费您额外的网络带宽,但不会花费您在任何情况下都需要付费的 DynamoDB 操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM