0
{
  "version": "2018-05-29",
  "operation": "Query",
  "index": "sportLeague",
  "query": {
  "expression": "sportIdLeagueId = :sportIdLeagueId and gsSK = :gsSK",
    "expressionValues": {
    #set( $sportIdLeagueId = $util.dynamodb.toDynamoDBJson("fixture#${ctx.args.input.sportId}#${ctx.args.input.leagueId}") )
    ":sportIdLeagueId": $sportIdLeagueId,
  }
 },
 "filter" : {
    "expression" : "between(#title, :title)",
    "expressionNames" : {
        "#startDateUtc" : "startDateUtc"
    }
    "expressionValues" : {
        ":start" : $util.dynamodb.toDynamoDBJson($ctx.args.input.startDateUtc)
    }
}
}

i need a between condition to satisfy the requirement requirement: get data between two dates i.e start date and end date

reema dass
  • 33
  • 7

1 Answers1

0

You attribute names and values need to match what is in your expression. (:title needs to have a corresponding value in expressionNames and expressionValues)

Also the between operator syntax is BETWEEN :startDateUtc AND :endDateUtc

There is a tutorial for using DynamoDB Query in AppSync:

https://docs.aws.amazon.com/appsync/latest/devguide/tutorial-dynamodb-resolvers.html#setting-up-the-allpostsbyauthor-resolver-ddb-query

DynamoDB expressions: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.ConditionExpressions.html

Tinou
  • 5,908
  • 4
  • 21
  • 24