我正在使用 MongoDB Enterprise,MongoDB shell 版本:3.2.5
我有一个 db = mydb 和一个 collections = ['events', 'events__2015-12-01', 'events__2015-11-01']
我有一个 python/pymongo 脚本,我可以在其中连接到每个文档,但是在 mongo shell 中我无法连接到过时的集合?
换句话说
mongodb> use mydb
switched to db mydb
mongodb> db.event
mydb/event
mongodb> db.event__2015-12-01
NaN
mongodb> db.event__2015-11-01
NaN
mongodb> show collections
event
event__2015-11-01
event__2015-12-01
为什么这会发生在外壳中?
编辑:
注意:进一步检查Mongo 文档。明确指出带有特殊字符的集合只能通过 getCollection() 方法访问