VTL - Typeahead

Direct integration search on DynamoDB

The snippet demonstrates how to do a search against a GSI and filter the results by text containing a specific string

Direct integration typeahead

#set( $pageKey = $input.params('pageKey'))
{
  "TableName": "myTable",
  "IndexName":"OwnerIndex",
  "KeyConditionExpression": "#n_owner = :v_owner",
  "FilterExpression": "contains(#n_id, :v_searchString)",
  "ExpressionAttributeValues": {
    ":v_owner": {"S": "$context.authorizer.claims.email"},
    ":v_searchString":{"S":"$input.params().path.searchString"}
  },
  "ExpressionAttributeNames": {"#n_owner": "owner", "#n_id":"id"}
}
                                


Created by:

Eric Johnson

Eric Johnson

Eric Johnson is a Principal Developer Advocate for Serverless Applications at Amazon Web Services and is based in Northern Colorado. Eric is a fanatic about serverless and enjoys helping developers understand how serverless technologies introduces a major paradigm shift in how they approach building and running applications at massive scale with minimal administration overhead. Prior to this, Eric has worked as a developer, solutions architect and AWS Evangelist for an AWS partner company.

Follow on LinkedIn