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


用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"这个名字,换个集合名字就好了。


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM