linux目录规则
2015-08-23 19:54
483 查看
1.
The MongoDB command interface
provides access to all non CRUD
database operations.
2.
A command is sent to the
database as a query to a special collection namespace called
$cmd
. The
database will return a single document with the command results:
The shell provides a helper function for this:
3.
All commands return, at
minimum, a document with an ok
field indicating whether the command has
succeeded:
If the command fails, the value of ok
will be 0.
4.
For many db commands, some
drivers implement wrapper methods to make usage easier. To check our database's
current profile level setting:
Or, you can use a corresponding wrapper method:
Its implementation is:
5.
Certain operations are for the
database administrator only. These privileged operations may only be performed
on the special database named admin
:
If the db
variable is not set to 'admin
', you can use adminCommand
(_adminCommand
in versions earlier than 1.8
) to switch to the right database
automatically (and just for that operation):
6.
Use commandHelp
in shell to get
help info for a command:
7.
For detailed command reference,
please refer :
http://docs.mongodb.org/manual/reference/commands/
The MongoDB command interface
provides access to all non CRUD
database operations.
2.
A command is sent to the
database as a query to a special collection namespace called
$cmd
. The
database will return a single document with the command results:
db.$cmd.findOne( { <commandname>: <value> [, options] } );
The shell provides a helper function for this:
db.runCommand( { <commandname>: <value> [, options] } );
3.
All commands return, at
minimum, a document with an ok
field indicating whether the command has
succeeded:
{ 'ok': 1 }
If the command fails, the value of ok
will be 0.
4.
For many db commands, some
drivers implement wrapper methods to make usage easier. To check our database's
current profile level setting:
> db.runCommand({profile:-1}); { "was" : 0.0 , "ok" : 1.0 }
Or, you can use a corresponding wrapper method:
> db.getProfilingLevel() 0.0
Its implementation is:
> print( db.getProfilingLevel ) function () { var res = this._dbCommand({profile:-1}); return res ? res.was : null; } > print( db._dbCommand ) function (cmdObj) { return this.$cmd.findOne(cmdObj); }
5.
Certain operations are for the
database administrator only. These privileged operations may only be performed
on the special database named admin
:
> use admin; > db.runCommand("shutdown"); // shut down the database
If the db
variable is not set to 'admin
', you can use adminCommand
(_adminCommand
in versions earlier than 1.8
) to switch to the right database
automatically (and just for that operation):
> db.adminCommand("shutdown");
6.
Use commandHelp
in shell to get
help info for a command:
> db.commandHelp("datasize")
7.
For detailed command reference,
please refer :
http://docs.mongodb.org/manual/reference/commands/
相关文章推荐
- linux权限命令
- linux软件包管理
- linux搜索命令
- linux文件命令
- linux文件压缩命令
- linux下mysql的root密码忘记解决方
- Linux学习笔记――Linux基础命令总结
- Linux C++ 服务器端学习方法
- Linux学习日记--基础命令(1)--ls,帮助,LFS
- CentOS6配置本地光盘yum源
- linux:vim基础
- 820作业,常用命令
- Arch Linux 下Android 源码的下载以及编译
- Linux 脚本初探
- linux默认头文件
- linux安装mysql yum No package mysql-server available.
- 在MAC下如何用SSH连接远程LINUX服务器
- Linux常用命令和简单知识
- linux下sudo增添日志文件
- Linux 添加交换分区的步骤