当前位置:网站首页>Redis implements paging
Redis implements paging
2022-06-09 16:21:00 【Fox catsup】
redis Implement paging
Use in order zadd
Use hash Store specific data
Get data through an ordered set of ZREVRANGE— Descending sort
Code case
// Sort in descending chronological order
// Save the data
$redis->zAdd($key,$article['add_time'],'article:'.$artice['id']);
$redis->hMset('article'.$article['id'],$article);
// Take the data
$result = $redis->zRevRange($key,$start,$start+10,true); // Get data , every time 10 Data
$count = $redis->ZCARD($key); // Get the total number
foreach($result as $k=>$v){
$article = $reids->hGetAll($k) // Specific data of each article
}边栏推荐
- 接口测试系列——AutoDiff流量回放在集成测试中的实践应用
- Moonriver Network与Calamari Network完成XCM集成
- Dapr 源码解析 | 基本介绍
- R language generalized linear model function GLM, GLM function to build logistic regression model, analyze whether the model is over dispersed, and use hypothesis test to analyze whether the model is
- June training (day 09) - two point search
- Consul learning
- 读《中台架构与实现》
- R语言使用aov函数进行双因素方差分析(Two-way factorial ANOVA)、gplots包的plotmeans函数在双因素方差分析中显示交互作用、包括均值,误差条、95%置信区间、样本量
- Byte side: how to check if the website cannot be displayed?
- [SEETF]Super Secure Requests Forwarder
猜你喜欢

What is a microservice architecture?

Data security is urgent. What is the significance of the first SOC 2 authentication report for domestic intelligent manufacturers?

The end of an era! Wu Enda's classic machine learning course was closed this month however

数据库存储目录结构简介

"CSDN powder raising strategy" 11 powder raising methods, how many have you learned?

Dapr source code analysis | basic introduction

Kubernetes core concepts

Win10找不到飞行模式开关怎么办?

读《中台架构与实现》

字节一面:网站显示不出来,怎么排查?
随机推荐
JWT思维导图
R language generalized linear model function GLM, GLM function to build logistic regression model, analyze whether the model is over dispersed, and use hypothesis test to analyze whether the model is
技术 - 中台
10个必备的AutoCAD插件
看完就会,从抓包到接口测试的全过程解析
Kubernetes core concepts
May training (day 23) - dictionary tree
Senior openstacker - Bloomberg, vexxhost upgraded to gold member of openinfra Foundation
JPEX推出BAYC MAYC合约系列 欢迎体验
618. How to prepare for the great promotion
"CSDN powder raising strategy" 11 powder raising methods, how many have you learned?
还在从零开始搭建项目?这款升级版快速开发脚手架值得一试~
面试官问我一条update语句加了多少锁?我总结了全套八股文
【第18天】给定两个变量 a 和 b,交换它们的值 | 三种解法
WordPress网站底部的自定页面(如:网站地图等)按钮美化教程
Today's sleep quality record 82 points
美妆品牌与消费者需求更迭之后,零售商们如何不掉队?
leetcode:189.轮转数组
Ruoyi mind map
dotnet core 发布只带必要的依赖文件