我需要在 jsp 上显示最大计数为 10 的搜索结果,并且它应该有一个分页来作为分页功能来回遍历。
Dynamodb有lastevaluatedkey,但它并不能帮助回到以前的页面,但我可以移动到由下一个结果集lastevaluatedKey。
任何人都可以请帮忙。
我使用 Java SPRING 和 DynamoDB 作为堆栈。
谢谢萨蒂亚
要启用前进/后退,您所需要做的就是保留
the first key,这是hash key + sort key之前返回的页面的第一条记录(如果要查询第一页,则为空)。
和
the last key检索到的页面的,即hash key + sort key先前返回的页面的最后一条记录的
然后要向前或向后导航,需要在查询请求中传入以下参数:
Forward: last key as the ExclusiveStartKey, order = ascend
Backward: first key as the ExclusiveStartKey, order = descend
我在 2016 年的一个项目中实现了这一点。DynamoDB 现在可能会提供一些类似的方便的 API,但我不确定,因为我很长时间没有检查 DynamoDB。
| 归档时间: |
|
| 查看次数: |
9823 次 |
| 最近记录: |