I am trying to query using an index but keep getting this error:
ValidationException: Query condition missed key schema element: trackID
Here is my .arc file
@tables
skytracks
trackID *String
_ttl TTL
@indexes
skytracks
skyTrackType *String
Here is the relevant piece of the http get handler:
const skyTrackType = req.queryStringParameters.skytracktype
const data = await arc.tables()
const trackingData = await data.skytracks.query({
KeyConditionExpression: `skyTrackType = :skyTrackType`,
ExpressionAttributeValues: {
':skyTrackType': skyTrackType
}
})
Architect automatically names the index
attribute-indexThis needs to be added to the query in the question:
IndexName: 'skyTrackType-index'