我希望能够限制在每个查询中获取的FETCH元素,但我在这里面临以下问题:
因为我在DynamoDB中使用单表设计,所以在这里我只得到了四个项目:
If I check the 10 first elements in DynamoDB, I will notice that I am getting the count here, regardless of the items I am filtering in my Scan operation
async paginate<TEntity>(
limit = 10,
start_key: any
TableName = $env.MAIN_TABLE
): Promise<Paginate<TEntity>> {
Assert.ok(TableName)
const items= await this.instance.scan({
TableName
Limit: limit,
ExclusiveStartKey: start_key,
FilterExpression: 'contains(PK, :PK)',
ExpressionAttributeValues: {
':PK': 'QUIZ#'
}
})
return items
}
这里有没有人知道解决这个问题的办法?