Mongo:show dbs 不显示测试数据库.为什么? [英] Mongo: show dbs doesn't show the test db. Why?

查看:92
本文介绍了Mongo:show dbs 不显示测试数据库.为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我第一次输入 mongo 时,我看到connecting to : test".但是,当我输入 show dbs 时,它不会向我显示 test db.我仍然可以看到 local,以及我创建的其他一些数据库...但不能看到 test.任何提示为什么?

When I first type mongo, I see "connecting to : test". However, when I type show dbs, it does not show me the test db. I can still see local, as well as some other dbs that I created... but not test. Any hints why?

推荐答案

如果你输入 db 你会看到你在名为 test 的数据库上,但它不会显示在列表中,即发生是因为测试数据库不包含任何文档,它是空的.如果您希望在键入 show dbs

If you type db you will see that you are on database named test, but it won't be shown in list, that happens because test db doesn't contain any document it is empty. You need to create at least one document in test database if you want it to be shown in list after typing show dbs

这篇关于Mongo:show dbs 不显示测试数据库.为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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