推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
hughooz
V2EX  ›  Python

请教下各位, redis 如何遍历出全部的键值对

  •  
  •   hughooz · May 29, 2019 · 3490 views
    This topic created in 2676 days ago, the information mentioned may be changed or developed.
    请教下各位,redis 如何遍历出全部的键值对
    3 replies  •  2019-05-31 17:48:15 +08:00
    kikoroc
        1
    kikoroc  
       May 29, 2019
    key 不多的话直接 keys *
    key 多的话用 scan
    liuguichao
        2
    liuguichao  
       May 30, 2019
    ns_keys = "kwd:*"
    cursor = '0'
    while cursor != 0:
    cursor, keys = redis_conn.scan(cursor=cursor, match=ns_keys, count=100)
    bnbdfg
        3
    bnbdfg  
       May 31, 2019
    我也喜欢 keys *
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2727 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 14:15 · PVG 22:15 · LAX 07:15 · JFK 10:15
    ♥ Do have faith in what you're doing.