Chinaunix首页 | 论坛 | 博客
  • 博客访问: 579083
  • 博文数量: 111
  • 博客积分: 3478
  • 博客等级: 中校
  • 技术积分: 1327
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-28 22:37
文章分类

全部博文(111)

文章存档

2013年(4)

2012年(57)

2011年(15)

2010年(7)

2009年(28)

分类: Mysql/postgreSQL

2012-04-12 15:56:23

mongo的简单使用:

在mongo_install_dir/bin/mongo 来启动mongo shell,这个可以认为是mongo的客户端, mongo shell下常用的命令: help:查看mongo所有的支持命令具体如下: db.help() help on db methods

db.mycoll.help() help on collection methods

sh.help() sharding helpers

rs.help() replica set helpers

help admin administrative help

help connect connecting to a db

help keys                    key shortcuts
        help misc                    misc things to know
        help mr                      mapreduce

        show dbs                     show database names
        show collections             show collections in current database
        show users                   show users in current database
        show profile                 show most recent system.profile entries with time >= 1ms
        show logs                    show the accessible logger names
        show log [name]              prints out the last segment of log in memory, 'global' is default
        use                 set current database
        db.foo.find()                list objects in collection foo
        db.foo.find( { a : 1 } )     list objects in foo where a == 1
        it                           result of the last line evaluated; use to further iterate
        DBQuery.shellBatchSize = x   set default number of items to display on shell
        exit                         quit the mongo shell

mongoshell的在linux shell下的使用:

 

mongo_install_dir/bin/mongo admin --eval "db.shutdownServer()" (这个是关闭mongo server) mongo_install_dir/bin/mongo admin --eval "db.serverStatus()" (查看服务器状态)

mongo_install_dir/bin/mongo admin --eval "mongo shell指令“  (即可执行相关的功能)

 

mongodb启动问题:

./mongod: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

解决办法:安装 glibc

 

./mongod: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

 

安装:libstdc++

阅读(8587) | 评论(9) | 转发(0) |
给主人留下些什么吧!~~

mengchang2012-04-16 09:38:07

谢谢你的支持

mengchang2012-04-16 09:36:36

就是一些比较基础的东西

mengchang2012-04-16 09:36:10

谢谢

mengchang2012-04-16 09:35:50

嗯,这些就是基础的,不是做研发的很少用的深的

天的星星2012-04-15 21:05:47

呵呵,复杂的不是能一两句话说懂的,要自己看书~