• MongoDB


    http://www.cnblogs.com/libingql/archive/2011/06/09/2076440.html

    ===

    > show dbs
    admin          (empty)
    local          0.031GB
    nutch_eclipse  0.031GB
    test           (empty)
    > use nutch_eclipse
    switched to db nutch_eclipse
    > show collections
    system.indexes
    webpage
    > db.webpage.count()
    467
    > 

     ==

    > db.webpage.findOne()
    {
        "_id" : "cn.edu.hist.crjyxy:http/info/1012/1085.htm",
        "status" : 1,
        "fetchTime" : NumberLong("1439345028815"),
        "fetchInterval" : 2592000,
        "retriesSinceFetch" : 0,
        "score" : 0,
        "inlinks" : {
            "http://crjyxy·hist·edu·cn/zzjd·htm" : "关于2009年度中等职业学校专业骨干教师国家级培训的通知"
        },
        "markers" : {
            "dist" : "2"
        },
        "metadata" : {
            "_csh_" : BinData(0,"AAAAAA==")
        }
    }

    ==

    > db.webpage.distinct("_id")
    [
        "cn.edu.hist.chengj:http/pxjd/index.asp",
        "cn.edu.hist.crjyxy:http/200936122845946.rar",
        "cn.edu.hist.crjyxy:http/index.htm",
        "cn.edu.hist.crjyxy:http/info/1012/1075.htm",
        "cn.edu.hist.crjyxy:http/info/1012/1079.htm",
        "cn.edu.hist.yyylxy:http/",
        "cn.edu.hist.zdxx:http/",
        "cn.edu.hist.zgwyhdx:http/",
        "cn.edu.hist.zsxx:http/",
        "cn.edu.hist.zyyhjxy:http/",
        "cn.edu.hist.zzb:http/"
    ]
    > 

    ==

    > db.webpage.find().count()
    467

    ==

    > db.webpage.find().limit(5)
    { "_id" : "cn.edu.hist.crjyxy:http/info/1012/1085.htm", "status" : 1, "fetchTime" : NumberLong("1439345028815"), "fetchInterval" : 2592000, "retriesSinceFetch" : 0, "score" : 0, "inlinks" : { "http://crjyxy·hist·edu·cn/zzjd·htm" : "关于2009年度中等职业学校专业骨干教师国家级培训的通知" }, "markers" : { "dist" : "2" }, "metadata" : { "_csh_" : BinData(0,"AAAAAA==") } }
    { "_id" : "cn.edu.hist.jwc:http/jwxw.htm", "status" : 1, "fetchTime" : NumberLong("1439345028926"), "fetchInterval" : 2592000, "retriesSinceFetch" : 0, "score" : 0, "inlinks" : { "http://jwc·hist·edu·cn/" : "" }, "markers" : { "dist" : "2" }, "metadata" : { "_csh_" : BinData(0,"AAAAAA==") } }
    { "_id" : "cn.edu.hist.chengj:http/pxjd/index.asp", "status" : 1, "fetchTime" : NumberLong("1439345028769"), "fetchInterval" : 2592000, "retriesSinceFetch" : 0, "score" : 0, "inlinks" : { "http://crjyxy·hist·edu·cn/info/1012/1078·htm" : "http://chengj.hist.edu.cn/pxjd/index.asp" }, "markers" : { "dist" : "3" }, "metadata" : { "_csh_" : BinData(0,"AAAAAA==") } }
    { "_id" : "cn.edu.hist.crjyxy:http/200936122845946.rar", "status" : 1, "fetchTime" : NumberLong("1439345028786"), "fetchInterval" : 2592000, "retriesSinceFetch" : 0, "score" : 0, "inlinks" : { "http://crjyxy·hist·edu·cn/info/1012/1084·htm" : "教育部文件.rar" }, "markers" : { "dist" : "3" }, "metadata" : { "_csh_" : BinData(0,"AAAAAA==") } }
    { "_id" : "cn.edu.hist.www:http/info/1099/9733.htm", "status" : 1, "fetchTime" : NumberLong("1439345029107"), "fetchInterval" : 2592000, "retriesSinceFetch" : 0, "score" : 0, "inlinks" : { "http://www·hist·edu·cn/index/sy/tzgg/kjc·htm" : "关于我校组织参加“第四届中国创新创业大赛河南赛区暨河南省科技创业雏鹰大赛”的通知" }, "markers" : { "dist" : "2" }, "metadata" : { "_csh_" : BinData(0,"AAAAAA==") } }

    == 

    > db.webpage.find().skip(466)
    { "_id" : "cn.edu.hist.zzb:http/", "status" : 1, "fetchTime" : NumberLong("1439345029199"), "fetchInterval" : 2592000, "retriesSinceFetch" : 0, "score" : 0, "inlinks" : { "http://www·hist·edu·cn/jgsz/dqjg·htm" : "党委组织部" }, "markers" : { "dist" : "2" }, "metadata" : { "_csh_" : BinData(0,"AAAAAA==") } }

    ====

    > db.webpage.remove({})
    WriteResult({ "nRemoved" : 467 })
    > db.webpage.find().count()
    0

    ==

  • 相关阅读:
    GSON -JSON 反序列化-多节点名称支持
    Jedis 分片原理
    闭锁-CountDownLatch
    XML序列化及反序列化
    用GIT操作SVN
    报表worker-CPU使用率过高原因排查
    二.PlantUML 之活动图
    一.PlantUML 与 IDEA 集成
    ArrayList
    VI常用命令
  • 原文地址:https://www.cnblogs.com/zhjsll/p/4723821.html
Copyright © 2020-2023  润新知