MongoDB显示所有集合的所有内容 [英] MongoDB Show all contents from all collections

查看:2556
本文介绍了MongoDB显示所有集合的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在MongoDB中显示所有集合及其内容?

Is it possible to show all collections and its contents in MongoDB?

是唯一一个一个显示的方法吗?

Is the only way to show one by one?

推荐答案

一旦您进入终端/命令行,请按以下方式访问要使用的数据库/集合:

Once you are in terminal/command line, access the database/collection you want to use as follows:

show dbs
use <db name>
show collections

选择您的收藏集,然后键入以下内容以查看该收藏集的所有内容:

choose your collection and type the following to see all contents of that collection:

db.collectionName.find()

有关更多信息,请参见 MongoDB快速参考指南.

More info here on the MongoDB Quick Reference Guide.

这篇关于MongoDB显示所有集合的所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆