【发布时间】:2017-02-27 00:36:12
【问题描述】:
我正在尝试在 mongoDB shell 中返回集合数据。 这些是我在 MongoDB shell 中输入的命令:
> **show dbs**
local 0.000GB
messages 0.000GB
restapi 0.000GB
> **use restapi**
switched to db restapi
> **show collections**
messages
> **restapi.messages.find()**
错误:
2017-02-26T19:03:50.024+0200 E QUERY [thread1] ReferenceError: restapi 未定义:`
为了表明我在消息集合中确实有记录,我附上截图:
为什么我无法查看收藏内容?
【问题讨论】:
-
试试
db.messages.find()是 mongo shell 语法,类似于你对 robomongo 的语法。更多这里docs.mongodb.com/manual/reference/method/db.collection.find -
谢谢!我虽然
db表示数据库名称!
标签: mongodb