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

  • 相关阅读:
    项目总结
    个人博客
    个人博客
    个人博客
    个人博客
    个人博客
    个人博客
    个人博客
    个人博客
    浅谈Vue与swiper轮播图框架结合小案例
  • 原文地址:https://www.cnblogs.com/bugutian/p/12192332.html
Copyright © 2020-2023  润新知