当前位置:网站首页>Redis顺序排序命令
Redis顺序排序命令
2022-06-26 15:50:00 【华为云】
Redis顺序排序命令
redis> LPUSH today_cost 30 1.5 10 8(integer) 4# 排序redis> SORT today_cost1) "1.5"2) "8"3) "10"4) "30"
排序键指示理论是设立一个和戒指的下表宽度相近的链表,链表的每个项都是再分派目标构造,根据分类法指示的模块有所不同再分派目标的构造也有所不同
管理器是
typedef struct _redisSortObject { robj *obj; union { double score; robj *cmpobj; } u;} redisSortObject;
obj指向确切的下表元素值,分数值是列表项的数值的浮点,然后根据积分的数值对链表展开字符尺寸的顺序,然后将顺序之后的结论回到给顾客端
其他选项模块展开顺序
分类法指示管理器按字符展开顺序,需字符串值的键排序的时,插入阿尔法选项
asc选项是升序,desc选项是降序,limit选项是对排序后的结果进行限制,by选项是可以按照某些字符串的键或者哈希键包含的域作为元素的权重来进行排序,get选项是根据排序结果取出相应的键值,store选项是对排序结果进行保存到指定的键中
指示模块的次序
这几个选项的执行顺序先是排序,然后是limit选项,限制排序结果长度,然后是get选项获取外部键,然后是store选项进行结果集的保存。
除了接到指示之外,其他指示模块的先后顺序对结果集没冲击
好了,今天内容主要讲解了一下redis的sort排序指令以及它的各个参数,比如asc选项是升序的意思,desc降序,limit对排序后的结果限制,by选项按照字符串的键权重排序,get选项从结果出取出相应的键值,store选项是将排序结果保存到指定键,sort key命令原理是创建一个和key的列表长度相同的数组,数组的每个项都是redisSortObject结构,根据sort命令的选项不同redisSortObject的结构也不同。
️ 感谢大家
如果你觉得这篇内容对你挺有有帮助的话:
- 欢迎关注我️,点赞,评论,转发
- 关注
盼盼小课堂
,定期为你推送好文,还有群聊不定期抽奖活动,可以畅所欲言,与大神们一起交流,一起学习。 - 有不当之处欢迎批评指正。
边栏推荐
- OpenSea上如何创建自己的NFT(Polygon)
- Selenium saves elements as pictures
- Oilfield exploration problems
- NFT合约基础知识讲解
- 【leetcode】701. 二叉搜索树中的插入操作
- How to identify contractual issues
- Why are encoder and decoder structures often used in image segmentation tasks?
- 01 backpack DP
- Canvas three dot flashing animation
- When a project with cmake is cross compiled to a link, an error cannot be found So dynamic library file
猜你喜欢
What is the process of switching C # read / write files from user mode to kernel mode?
Transformation of zero knowledge QAP problem
2 three modeling methods
Development, deployment and online process of NFT project (1)
SAP OData development tutorial - from getting started to improving (including segw, rap and CDP)
SAP OData 开发教程 - 从入门到提高(包含 SEGW, RAP 和 CDP)
Practice of federal learning in Tencent micro vision advertising
NFT transaction principle analysis (1)
振动式液量检测装置
NFT transaction principle analysis (2)
随机推荐
STEPN 新手入門及進階
Auto Sharding Policy will apply Data Sharding policy as it failed to apply file Sharding Policy
Solidus labs welcomes zhaojiali, former head of financial innovation in Hong Kong, as a strategic adviser
How to create your own NFT (polygon) on opensea
3 keras版本模型训练
Everyone is a scientist free gas experience Mint love crash
面试踩坑总结一
IAR工程适配GD32芯片
JS text scrolling scattered animation JS special effect
5000 word analysis: the way of container security attack and defense in actual combat scenarios
【leetcode】331. Verifying the preorder serialization of a binary tree
IntelliJ idea -- Method for formatting SQL files
Stepn novice introduction and advanced
牛客小白月赛50
零知识 QAP 问题的转化
C语言读取数据
Canvas three dot flashing animation
NFT transaction principle analysis (2)
【leetcode】701. Insert operation in binary search tree
NFT交易原理分析(1)