简体   繁体   English

我如何在Mongodb中执行“显示”语句

[英]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 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM