-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
createdBy-itemType-index is getting used in a single API call which just uses node id as the primary information to be extracted from the GSI.
Code Snippet :
fun getAllNodesWithUserID(userID: String): List<String> {
val expressionAttributeValues: MutableMap<String, AttributeValue> = HashMap()
expressionAttributeValues[":createdBy"] = AttributeValue(userID)
expressionAttributeValues[":itemType"] = AttributeValue("Node")
expressionAttributeValues[":deleted"] = AttributeValue().withN("1")
return DynamoDBQueryExpression<Node>().queryWithIndex(
index = "createdBy-itemType-index", keyConditionExpression = "createdBy = :createdBy and itemType = :itemType",
projectionExpression = "PK", expressionAttributeValues = expressionAttributeValues, filterExpression = "deleted <> :deleted"
).let { it ->
mapper.query(Node::class.java, it, dynamoDBMapperConfig).map { node ->
node.id
}
}
}
So, we don't need every attribute in the GSI.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels