设为首页 加入收藏

TOP

Linux下快速安装MongoDB(三)
2015-11-13 01:24:28 来源: 作者: 【 】 浏览:41
Tags:Linux 快速 安装 MongoDB
? 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 eva luated; use to further iterate
? ? ? ? DBQuery.shellBatchSize = x? set default number of items to display on shell
? ? ? ? exit? ? ? ? ? ? ? ? ? ? ? ? quit the mongo shell
> db.getCollection("version");
test.version
> exit
bye


三、mongodb相关工具
###在安装文件下有README,描述了常用的mongodb相关命令行工具
# more /usr/local/mongodb/README
MongoDB README
Welcome to MongoDB!
COMPONENTS


? bin/mongod - The database process.
? bin/mongos - Sharding controller.
? bin/mongo? - The database shell (uses interactive java script).


UTILITIES


? bin/mongodump? ? ? ? - MongoDB dump tool - for backups, snapshots, etc..
? bin/mongorestore? ? ? - MongoDB restore a dump
? bin/mongoexport? ? ? - Export a single collection to test (JSON, CSV)
? bin/mongoimport? ? ? - Import from JSON or CSV
? bin/mongofiles? ? ? ? - Utility for putting and getting files from MongoDB GridFS
? bin/mongostat? ? ? ? - Show performance statistics


RUNNING


? For command line options invoke:


? ? $ ./mongod --help


? To run a single server database:


? ? $ mkdir /data/db
? ? $ ./mongod
? ? $
? ? $ # The mongo java script shell connects to localhost and test database by default:
? ? $ ./mongo
? ? > help


DRIVERS


? Client drivers for most programming languages are available at mongodb.org.? Use the
? shell ("mongo") for administrative tasks.


###获取单个命令用法
# --help
# mongod --help|more
Options:


General options:
? -h [ --help ]? ? ? ? ? ? ? show this usage information
? --version? ? ? ? ? ? ? ? ? show version information


# mongod --version
db version v3.0.6
git version: 1ef45a23a4c5e3480ac919b28afcba3c615488f2?


更多MongoDB相关内容可以看看以下的有用链接:?


首页 上一页 1 2 3 下一页 尾页 3/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇shell脚本:<批量检查并更改My.. 下一篇Linux平台Oracle连接MySQL

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: