0.参考资料

https://redis.io/topics/data-types-intro  An introduction to Redis data types and abstractions

http://redisdoc.com/  Redis 命令参考

1.scrapy_redis

2.redis-cli 查看数据

2.1 匹配数据库内所有 key

redis-cli

127.0.0.1:6379> KEYS *
1) "mycrawler_redis:dupefilter"
2) "mycrawler_redis:requests"
6) "mycrawler_redis:items"

2.2 List(列表)

127.0.0.1:6379> type mycrawler_redis:items
list
127.0.0.1:6379> llen mycrawler_redis:items
(integer) 701
127.0.0.1:6379> LRANGE mycrawler_redis:items 0 1
1) "{\"text\": \"\\u201cA woman is like a tea bag; you never know how strong it is until it's in hot water.\\u201d\", \"crawled\": \"2018-02-21 03:38:17\", \"spider\": \"mycrawler_redis\", \"author\": \"Eleanor Roosevelt\"}"
2) "{\"text\": \"\\u201cThe world as we have created it is a process of our thinking. It cannot be changed without changing our thinking.\\u201d\", \"crawled\": \"2018-02-21 03:38:17\", \"spider\": \"mycrawler_redis\", \"author\": \"Albert Einstein\"}"
127.0.0.1:6379> LRANGE mycrawler_redis:items -2 -1
1) "{\"text\": \"\\u201cThe opposite of love is not hate, it's indifference. The opposite of art is not ugliness, it's indifference. The opposite of faith is not heresy, it's indifference. And the opposite of life is not death, it's indifference.\\u201d\", \"crawled\": \"2018-02-21 03:43:34\", \"spider\": \"mycrawler_redis\", \"author\": \"Elie Wiesel\"}"
2) "{\"text\": \"\\u201cIt is not a lack of love, but a lack of friendship that makes unhappy marriages.\\u201d\", \"crawled\": \"2018-02-21 03:43:34\", \"spider\": \"mycrawler_redis\", \"author\": \"Friedrich Nietzsche\"}"

2.3 Set(集合)

PS: size是容量,但cardinality是「基数」,是集合论中的术语

127.0.0.1:6379> type mycrawler_redis:dupefilter
set
127.0.0.1:6379> SCARD mycrawler_redis:dupefilter
(integer) 18603
127.0.0.1:6379> SRANDMEMBER mycrawler_redis:dupefilter
"5faa874e145528c84d636d5a95959583301e18f2"
127.0.0.1:6379> SRANDMEMBER mycrawler_redis:dupefilter
"68f9f6842efcd0392236b953ba6cf5c4616d4c91"

2.4 SortedSet(有序集合)

20180726 更新: 也可通过 ZCARD key命令返回有序集 key 的基数。

127.0.0.1:6379> type mycrawler_redis:requests
zset
127.0.0.1:6379> ZLEXCOUNT mycrawler_redis:requests - +
(integer) 18199
127.0.0.1:6379> ZRANGE mycrawler_redis:requests 0 1 WITHSCORES
1) "\x80\x02}q\x01(U\x04bodyq\x02U\x00U\t_encodingq\x03U\x05utf-8q\x04U\acookiesq\x05}q\x06U\x04metaq\a}q\b(U\x05depthq\tK\x02U\tlink_textq\nclxml.etree\n_ElementStringResult\nq\x0bU\x0cspiritualityq\x0c\x85\x81q\r}q\x0e(U\a_parentq\x0fNU\x0cis_attributeq\x10\x89U\battrnameq\x11NU\ais_textq\x12\x89U\ais_tailq\x13\x89ubU\x04ruleq\x14K\x00uU\aheadersq\x15}q\x16U\aRefererq\x17]q\x18U https://www.goodreads.com/quotesq\x19asU\x03urlq\x1aX1\x00\x00\x00https://www.goodreads.com/quotes/tag/spiritualityU\x0bdont_filterq\x1b\x89U\bpriorityq\x1cK\x00U\bcallbackq\x1dU\x14_response_downloadedq\x1eU\x05flagsq\x1f]q U\x06methodq!U\x03GETq\"U\aerrbackq#Nu."
2) "0"
3) "\x80\x02}q\x01(U\x04bodyq\x02U\x00U\t_encodingq\x03U\x05utf-8q\x04U\acookiesq\x05}q\x06U\x04metaq\a}q\b(U\x05depthq\tK\x02U\tlink_textq\nclxml.etree\n_ElementStringResult\nq\x0bU\rChoice Awardsq\x0c\x85\x81q\r}q\x0e(U\a_parentq\x0fNU\x0cis_attributeq\x10\x89U\battrnameq\x11NU\ais_textq\x12\x89U\ais_tailq\x13\x89ubU\x04ruleq\x14K\x00uU\aheadersq\x15}q\x16U\aRefererq\x17]q\x18U https://www.goodreads.com/quotesq\x19asU\x03urlq\x1aX&\x00\x00\x00https://www.goodreads.com/choiceawardsU\x0bdont_filterq\x1b\x89U\bpriorityq\x1cK\x00U\bcallbackq\x1dU\x14_response_downloadedq\x1eU\x05flagsq\x1f]q U\x06methodq!U\x03GETq\"U\aerrbackq#Nu."
4) "0"
127.0.0.1:6379> ZRANGE mycrawler_redis:requests -2 -1 WITHSCORES
1) "\x80\x02}q\x01(U\x04bodyq\x02U\x00U\t_encodingq\x03U\x05utf-8q\x04U\acookiesq\x05}q\x06U\x04metaq\a}q\b(U\tlink_textq\tX\x00\x00\x00\x00U\x04ruleq\nK\x00U\x10download_timeoutq\x0bG@f\x80\x00\x00\x00\x00\x00U\x05depthq\x0cK\x02U\x0bretry_timesq\rK\x01U\rdownload_slotq\x0eU\x0fwww.youtube.comq\x0fuU\aheadersq\x10}q\x11(U\x0fAccept-Languageq\x12]q\x13U\x02enq\x14aU\aRefererq\x15]q\x16U\x17https://scrapinghub.comq\x17aU\x0fAccept-Encodingq\x18]q\x19U\x0cgzip,deflateq\x1aaU\x06Acceptq\x1b]q\x1cU?text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8q\x1daU\nUser-Agentq\x1e]q\x1fU7scrapy-redis (+https://github.com/rolando/scrapy-redis)q auU\x03urlq!X#\x00\x00\x00https://www.youtube.com/scrapinghubU\x0bdont_filterq\"\x88U\bpriorityq#J\xff\xff\xff\xffU\bcallbackq$U\x14_response_downloadedq%U\x05flagsq&]q'U\x06methodq(U\x03GETq)U\aerrbackq*Nu."
2) "1"
3) "\x80\x02}q\x01(U\x04bodyq\x02U\x00U\t_encodingq\x03U\x05utf-8q\x04U\acookiesq\x05}q\x06U\x04metaq\a}q\b(U\tlink_textq\tX\x00\x00\x00\x00U\x04ruleq\nK\x00U\x10download_timeoutq\x0bG@f\x80\x00\x00\x00\x00\x00U\x05depthq\x0cK\x02U\x0bretry_timesq\rK\x01U\rdownload_slotq\x0eU\x10www.facebook.comq\x0fuU\aheadersq\x10}q\x11(U\x0fAccept-Languageq\x12]q\x13U\x02enq\x14aU\aRefererq\x15]q\x16U\x17https://scrapinghub.comq\x17aU\x0fAccept-Encodingq\x18]q\x19U\x0cgzip,deflateq\x1aaU\x06Acceptq\x1b]q\x1cU?text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8q\x1daU\nUser-Agentq\x1e]q\x1fU7scrapy-redis (+https://github.com/rolando/scrapy-redis)q auU\x03urlq!X%\x00\x00\x00https://www.facebook.com/ScrapingHub/U\x0bdont_filterq\"\x88U\bpriorityq#J\xff\xff\xff\xffU\bcallbackq$U\x14_response_downloadedq%U\x05flagsq&]q'U\x06methodq(U\x03GETq)U\aerrbackq*Nu."
4) "1"

scrapy_redis 相关: 查看保存的数据的更多相关文章

  1. KnockoutJS 3.X API 第七章 其他技术(1) 加载和保存JSON数据

    Knockout允许您实现复杂的客户端交互性,但几乎所有Web应用程序还需要与服务器交换数据,或至少将本地存储的数据序列化. 最方便的交换或存储数据的方式是JSON格式 - 大多数Ajax应用程序今天 ...

  2. Android 一键直接查看Sqlite数据库数据

    转自:http://www.cnblogs.com/trinea/archive/2012/11/16/2773656.html 本文主要介绍Android开发中如何一键直接查看sqlite数据库中的 ...

  3. 6.Knockout.Js(加载或保存JSON数据)

    前言 Knockout可以实现很复杂的客户端交互,但是几乎所有的web应用程序都要和服务器端交换数据(至少为了本地存储需要序列化数据),交换数据最方便的就是使用JSON格式 – 大多数的Ajax应用程 ...

  4. 使用Log Explorer查看和恢复数据

    由于一次意外操作,把QC数据库中的BUG表数据给删掉了.崩溃-上网找了下恢复方法,找到一款Log Explorer.下载安装使用后,发现这款软件的确不错,收藏ing.   本次的使用的Log Expl ...

  5. Knockout应用开发指南 第六章:加载或保存JSON数据

    原文:Knockout应用开发指南 第六章:加载或保存JSON数据 加载或保存JSON数据 Knockout可以实现很复杂的客户端交互,但是几乎所有的web应用程序都要和服务器端交换数据(至少为了本地 ...

  6. cpu-z如何查看电脑配置数据方法介绍

    CPU-Z是款经典的内存检测工具,具有5大功能,使用CPU-Z可以查询电脑的处理器.缓存.主板.内存.显卡以及SPD的信息.但是怎么具体看哪一个项目呢?在今天的教程中,小编就跟大家分享一下cpu-z ...

  7. Knockout.Js官网学习(加载或保存JSON数据)

    前言 Knockout可以实现很复杂的客户端交互,但是几乎所有的web应用程序都要和服务器端交换数据(至少为了本地存储需要序列化数据),交换数据最方便的就是使用JSON格式 – 大多数的Ajax应用程 ...

  8. sql server 2005 使用Log Explorer查看和恢复数据

    使用Log Explorer查看和恢复数据    Log Explorer 4.1.可用于SQL Server2005的日志查看工具   下载地址: http://download.csdn.net/ ...

  9. gdb 调试(查看运行时数据)(五)

    查看栈信息 当程序被停住了,首先要确认的就是程序是在哪儿被断住的.这个一般是通过查看调用栈信息来看的.在gdb中,查看调用栈的命令是backtrace,可以简写为bt. (gdb) bt    #0 ...

随机推荐

  1. 返回通知 对方法返回的结果可以进行加工 例如请求接口后 返回的json参数可以加工成对象返回给调用者

  2. iOS 高德自定义坐标轨迹绘制动画 类似与Keep的轨迹绘制

    2. 自定义 线的图片,只需要在 rendererForOverlay 方法中,设置: polylineRenderer.strokeImage = [UIImage imageNamed:@&quo ...

  3. 【数学建模】MATLAB语法

    一.向量.矩阵的表示和使用 format long  %小数很多format short %默认4位小数format rat %显示最近的分数format short e %指数格式的数 尾数多少 e ...

  4. vue学习笔记(四)- cmd无法识别vue命令解决方法

    解决控制台无法识别vue命令问题 作者:狐狸家的鱼 本文链接:cmd无法识别vue命令解决方法 GitHub:sueRimn 在控制台输入vue会报以下错误: vue : 无法将“vue”项识别为 c ...

  5. Vue+koa2开发一款全栈小程序(6.个人中心)

    1.用户信息的获取和展示 1.初始化数据库 cd到server目录下,执行 node tools/initdb.js 登录mysql控制界面,查看初始化以后生成的表 show databases; u ...

  6. 存储与服务器的连接方式对比(DAS,NAS,SAN)

    存储分类简介 磁盘存储市场上,存储分类根据服务器类型分为:封闭系统的存储和开放系统的存储,封闭系统主要指大型机,AS400等服务器,开放系统指基于包括Windows.UNIX.Linux等操作系统的服 ...

  7. C++(2):错误:undefined reference to `__gxx_personality_v0'

    1. Linux Develop Notes     * 编译 c++ 程序需要添加 -lstdc++   sample: gcc -lstdc++ -o test test.c,否则会报 " ...

  8. DirectX11 With Windows SDK--08 Direct2D与Direct3D互操作性以及利用DWrite显示文字

    前言 注意:从这一章起到后面的所有项目无一例外都利用了Direct2D与Direct3D互操作性,但系统要求为Win10, Win8.x 或 Win7 SP1且安装了KB2670838补丁以支持Dir ...

  9. 使用Spring-Integration实现http消息转发

    目标:接收来自华为云的服务器报警信息,并转发到钉钉的自定义机器人中 使用Spring-Integration不仅节省了很多配置,还增加了可用性. 更多关于Spring-Integration的介绍可参 ...

  10. 使用C语言中qsort()函数对浮点型数组无法成功排序的问题

    一 写在开头 1.1 本节内容 本节主要内容是有关C语言中qsort()函数的探讨. 二 问题和相应解决方法 qsort()是C标准库中的一个通用的排序函数.它既能对整型数据进行排序也能对浮点型数据进 ...