用mongodb创建集合之后死活不能插入数据

> db.createCollection('version');
{ "ok" : 1 }
> db.version.drop();
2020-01-14T15:35:27.868+0800 E QUERY    [thread1] TypeError: db.version.drop is not a function :
@(shell):1:1
> db.version.find();
2020-01-14T15:35:34.980+0800 E QUERY    [thread1] TypeError: db.version.find is not a function :
@(shell):1:1
> db.version.insert()
2020-01-14T15:35:46.161+0800 E QUERY    [thread1] TypeError: db.version.insert is not a function :
@(shell):1:1

问题出在哪里?
答:不要用"version"这个名字,换个集合名字就好了。

posted on 2020-01-14 15:38  步孤天  阅读(1628)  评论(0)    收藏  举报