zoukankan      html  css  js  c++  java
  • 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

    ==

  • 相关阅读:
    SQL 语句优化中间表的使用优化
    SQL 语句优化OR 语句优化案例
    浅谈系统优化设计复杂运算放在逻辑层还是在数据库层?
    linux命令综合
    MySQL常用命令
    PHP知识点积累
    [Git] 生成token解决github remote: Support for password authentication was removed on August 13, 2021.
    [uniapp] GOFLY在线客服系统 uniapp增加播放背景音效或者按钮音效
    [Golang]gorm更新数据update 解决值为0时被忽略
    光阴真的是贱(似箭),一不小心就又过一年了
  • 原文地址:https://www.cnblogs.com/zhjsll/p/4723821.html
Copyright © 2011-2022 走看看