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 use <db name> set curent database to <db name> db.addUser (username, password) db.removeUser(username) db.cloneDatabase(fromh...
db.cloneDatabase(fromhost) db.commandHelp(name) returns the helpforthe command db.copyDatabase(fromdb, todb, fromhost) db.createCollection(name, { size : ..., capped : ..., max : ... } ) db.currentOp() displays the current operationinthe db db.dropDatabase() db.eval(func, args...
show collections show collectionsincurrent database show users show usersincurrent database show profile show most recent system.profile entrieswithtime>=1ms show logs show the accessible logger names show log[name]prints out the last segmentofloginmemory,'global'isdefaultuse<db_name>setcurrent data...
复制 show dbs #查看所有数据库 db 或 db.getName()#查看当前使用的数据库 1. 2. (4) 显示当前db状态 复制 db.stats() 1. (5) 查看当前db版本 复制 db.version() 1. (6) 查看当前db的连接服务器机器地址 复制 db.getMongo() 1. (7) 删除当前使用数据库 复制 db.dropDatabase() 1. (8) 查...
传统的关系数据库一般由数据库(database)、表(table)、记录(record)三个层次概念组成,MongoDB是由数据库(database)、集合(collection)、文档对象(document)三个层次组成。MongoDB对于关系型数据库里的表,但是集合中没有列、行和关系概念,这体现了模式自由的特点。
Length of Database Names Database names cannot be empty and must be less than 64 bytes. Restriction on Collection Names Collection names should begin with an underscore or a letter character, andcannot: contain the$. be an empty string (e.g.""). ...
切换或者新建数据库 use DATABASE_NAME, 切换数据库时如果数据库不存在,则会创建它 删除数据库 db.dropDatabase() 显示所有表(集合)show tables 查看js方法的原型(源代码实现): db.xxx.insert, 随便写一个集合名字,集合后面跟函数名,不需要函数的参数 即可查看该函数的源码实现 // mong shell 是一种javascript...
> show dbs 2 admin0.000GB 3 myshinynewdb0.000GB 4 local0.000GB There’s one more thing. How did theinsertcommand know to put the data into myshinynewdb? It turns out that when you entered theusecommand, then myshinynewdb became the current database on which commands operate. ...
数据库(database),这是一个仓库,在仓库中可以存放集合 集合(collection),集合类似于数组,在集合中可以存放文档 文档(document),数据库中的最小单位,我们存储和操作的内容都是文档 基本指令 show 一般来说,数据库里放集合,集合里放文档 一般来说,数据库和集合都不需要手动创建,创建文档时(注意一定要是创建文档的...
... 通过上面看到当前执行的进程,类似MySQL的show processlist。可以添加过滤条件: zjy:PRIMARY> db.currentOP({"ns":"test"}) 四:监控MongoDB各个状态:mongotop、mongostat root@zhoujinyi:~# mongotop #查看那个几个最繁忙 ns total read write 2015-07-01T11:24:43-04:00 abc 0ms 0ms 0ms abc.AOE ...