• 请不要在回答技术问题时复制粘贴 AI 生成的内容
chenxx
V2EX  ›  程序员

评论的排序是怎么做

  •  
  •   chenxx · Oct 3, 2016 · 3022 views
    This topic created in 3573 days ago, the information mentioned may be changed or developed.

    请教各位,评论的排序是如何做的,我现在的网站的评论,赞和踩都是用 redis 来做的,我想用赞越多的排在越前面。

    4 replies    2016-10-07 10:45:49 +08:00
    Elven
        1
    Elven  
       Oct 4, 2016 via Android
    _(:з」∠)_一个排序就完了啊
    reus
        2
    reus  
       Oct 4, 2016
    你用数据库存就没这么多事情了。
    Jacklee
        3
    Jacklee  
       Oct 5, 2016
    既然是 Redis 不是有对应的数据类型么 Sort Set 有序集合,赞作为权重排个序
    mingyun
        4
    mingyun  
       Oct 7, 2016
    zset zadd commentid favs zrevrangebyscore
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5810 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 46ms · UTC 02:46 · PVG 10:46 · LAX 19:46 · JFK 22:46
    ♥ Do have faith in what you're doing.