[英]How do i do 'show' statement in Mongodb
What command shall I use when I want to know what databases are in mongodb and what collections are in a database (equals to show tables
statement in SQL )? 当我想知道mongodb中有哪些数据库以及数据库中有什么集合(等于在SQL中show tables
语句)时,应该使用什么命令? I only found {dbStats:1}
in docs that can only show information about current database without a list of collections. 我在文档中仅发现{dbStats:1}
该文档只能显示有关当前数据库的信息,而没有收集列表。
see the official document : 见官方文件 :
show dbs displays all the databases on the server you are connected to
use db_name switches to db_name on the same server
show collections displays a list of all the collections in the current database
It's show dbs
and show collections
: 它是show dbs
和show collections
:
http://www.mongodb.org/display/DOCS/Overview+-+The+MongoDB+Interactive+Shell#Overview-TheMongoDBInteractiveShell-SelectDatabase http://www.mongodb.org/display/DOCS/Overview+-+The+MongoDB+Interactive+Shell#Overview-TheMongoDBInteractiveShell-SelectDatabase
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.