DynamoDB DB扫描:在数组中的嵌入式对象上的过滤器
试图能够过滤看起来像这样的嵌入式对象:
"posts": [
{
"id": "10e85cf7-acd2-417b-a5dc-1dfb6de606bf",
"references": [
{
"type": "URL",
"title": "How to get dynamodb to only return certain columns",
},
{
"type": "HASHTAG",
"title": "#dynamodb",
},
]
},
...
]
我试图返回具有“主题标签”类型和值“ #dynamodb”的所有帖子。我已经尝试过此操作,但它总是返回null(在node.js中运行):
const params = {
TableName: "tableName",
ScanIndexForward: false,
FilterExpression: "#references.#type = :referenceValue",
ExpressionAttributeNames: {
"#references": "references",
"#type": "HASHTAG"
},
ExpressionAttributeValues: {
":referenceValue": "#dynamoDB"
}
}
const response = await docClient.scan(params).promise();
console.log(response);
仅返回(成功)一个空数组。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用:MAP 在
#references
指示的路径上。Use the contains function to filter on items in a list. In your case, return posts that have an item like
:map
at the path indicated by#references
.