休息api分页
Rest api pagination
我有一个用例,我有一个 api 从数据库中获取结果,我根据一组输入首选项验证请求并过滤结果。
我需要为此实现分页。我无法使用 mysql 查询分页,因为我没有直接从 sql 返回结果,我正在处理它然后过滤结果。
有什么方法可以获取整个结果并将处理后的结果存储在某个地方,例如 redis 或任何其他缓存存储,然后对其进行分页?
Is there any way that I can fetch the entire result and store the processed result somewhere like redis or any other cache store and then paginate over that ??
是:如此处解释:Reverse Pagination Through A Redis Sorted Set
我有一个用例,我有一个 api 从数据库中获取结果,我根据一组输入首选项验证请求并过滤结果。
我需要为此实现分页。我无法使用 mysql 查询分页,因为我没有直接从 sql 返回结果,我正在处理它然后过滤结果。
有什么方法可以获取整个结果并将处理后的结果存储在某个地方,例如 redis 或任何其他缓存存储,然后对其进行分页?
Is there any way that I can fetch the entire result and store the processed result somewhere like redis or any other cache store and then paginate over that ??
是:如此处解释:Reverse Pagination Through A Redis Sorted Set