如何在AWS AppSync中过滤AWSJSON对象?

问题描述 投票:0回答:1

我的APPSync已连接到dynamodb表,该架构如下所示:

type Query {
    getNews(date: String!): News
    listNews(filter: TableNewsFilterInput, limit: Int, nextToken: String): NewsConnection
}
input TableNewsFilterInput {
    date: TableStringFilterInput
    news: TableStringFilterInput
}

input TableStringFilterInput {
    ne: String
    eq: String
    le: String
    lt: String
    ge: String
    gt: String
    contains: AWSJSON
    notContains: String
    between: [String]
    beginsWith: String
}

dynamodb表中的新闻列是一个地图,看起来像这样:

{
abhijit banerjee:{
ampUrlString:   https://m.freepressjournal.in/article/business/rahul-gandhi-and-abhijit-banerjee-discuss-economic-crisis-amid-coronavirus-pandemic-here-are-the-highlights-of-their-conversation/5a5c3e42-9a55-4fce-8ac3-5b4a17125aca
}
}

我需要使用关键字(例如Abhijit)进行过滤。我在任何地方都找不到解决方案。任何帮助表示赞赏!

amazon-web-services aws-appsync
1个回答
0
投票

您可以使用查询来获取数据,然后应用过滤器。像这样的东西:

© www.soinside.com 2019 - 2024. All rights reserved.