zoukankan      html  css  js  c++  java
  • mongo__4.23

    也支持同 mysql 一样的读取启动配置文件的方式来启动数据库,配置文件的内容如下
        [root@localhost bin]# cat /etc/mongodb.cnf
        dbpath=/data/db/
    启动时加上”-f”参数,并指向配置文件即可
        [root@localhost bin]# ./mongod -f /etc/mongodb.cnf  
        Mon May 28 18:27:18 [initandlisten] MongoDB starting : pid=18481
        dbpath=/data/db/ 32-bit
        ......
        Mon May 28 18:27:18 [initandlisten] waiting for connections on port 27017
        Mon May 28 18:27:18 [websvr] web admin interface listening on port 28017


    find() 来查询, 他返回一个任意结构的集合.
    实现上面同样的查询, 然后通过 while 来输出


      > var cursor = db.things.find();
      > while (cursor.hasNext()) printjson(cursor.next());
      { "_id" : ObjectId("4c2209f9f3924d31102bd84a"), "name" : "mongo" }
      { "_id" : ObjectId("4c2209fef3924d31102bd84b"), "x" : 3 }
      { "_id" : ObjectId("4c220a42f3924d31102bd856"), "x" : 4, "j" : 1 }
      { "_id" : ObjectId("4c220a42f3924d31102bd857"), "x" : 4, "j" : 2 }
      { "_id" : ObjectId("4c220a42f3924d31102bd858"), "x" : 4, "j" : 3 }
      { "_id" : ObjectId("4c220a42f3924d31102bd859"), "x" : 4, "j" : 4 }
      { "_id" : ObjectId("4c220a42f3924d31102bd85a"), "x" : 4, "j" : 5 }

  • 相关阅读:
    Tensorflow使用环境配置
    学习笔记——EM算法
    学习笔记——提升方法
    学习笔记——支持向量机
    加入BOINC(伯克利开放式网络计算平台)
    斐波那契大数模板
    多重部分和的计数dp
    POJ 2674 Linear world
    POJ 1222 EXTENDED LIGHTS OUT(翻转+二维开关问题)
    POJ3185 The Water Bowls(反转法or dfs 爆搜)
  • 原文地址:https://www.cnblogs.com/ldms/p/3038026.html
Copyright © 2011-2022 走看看