javascriptnode.jsamazon-dynamodbdynamoose

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? 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/)


Solution

  • 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. This will cost you extra in network bandwidth, but not in DynamoDB operations for which you'll pay in any case.