E QUERY [thread1] TypeError: db.foo.batchInsert is not a function :
来源:互联网 发布:知乎搜索引擎入口 编辑:程序博客网 时间:2024/05/22 04:57
1.当前数据库版本 > db.version(); 3.2.32.进行对foo集合批量插入> db.foo.batchInsert([{"_id": 0},{"_id": 1},{"_id": 2}])db.foo.batchInsert([{"_id": 0},{"_id": 1},{"_id": 2}])2016-03-31T10:19:59.718+0800 E QUERY [thread1] TypeError: db.foo.batchInsert is not a function :@(shell):1:1 插入不成功会有以下 E QUERY [thread1] TypeError: db.foo.batchInsert is not a function :报错关于batchInsert,在<mongdb权威指南中>使用version 2.4.0的mongodb,其中使用batchInsert函数进行对foo集合进行批量插入3.在mongodb新版的v3.2.3中,batchInsert已经被废弃掉了,所以再用batchInsert执行批量插入是会报错:batchInsert is not a function 在v3.2.3版本直接使用insert实现对foo集合批量插入(注意的是insert大小写)4.如果使用 db.foo.Insert,会插入不成功> db.foo.Insert([{"_id": 0},{"_id": 1},{"_id": 2}])db.foo.Insert([{"_id": 0},{"_id": 1},{"_id": 2}])2016-03-31T10:28:31.195+0800 E QUERY [thread1] TypeError: db.foo.Insert is not a function :@(shell):1:15.使用小写的db.foo.insert,执行成功 > db.foo.insert([{"_id": 0},{"_id": 1},{"_id": 2}])db.foo.insert([{"_id": 0},{"_id": 1},{"_id": 2}])BulkWriteResult({ "writeErrors" : [ { "index" : 0, "code" : 11000, "errmsg" : "E11000 duplicate key error collection: test.foo index: _id_ dup key: { : 0.0 }", "op" : { "_id" : 0 } } ], "writeConcernErrors" : [ ], "nInserted" : 0, "nUpserted" : 0, "nMatched" : 0, "nModified" : 0, "nRemoved" : 0, "upserted" : [ ]})> 6.对插入结果使用db.foo.find()进行查询,批量插入成功> db.foo.find(){ "_id" : ObjectId("56f8d8149caa5bade991729b"), "bar" : "ba" }{ "_id" : ObjectId("56f8d9989caa5bade991729c"), "bar" : "2" }{ "_id" : ObjectId("56f8d99b9caa5bade991729d"), "bar" : "3" }{ "_id" : ObjectId("56f8d99d9caa5bade991729e"), "bar" : "4" }{ "_id" : ObjectId("56f8d9a69caa5bade991729f"), "bar" : "5" }{ "_id" : 0 }{ "_id" : 1 }{ "_id" : 2 }>
0 0
- E QUERY [thread1] TypeError: db.foo.batchInsert is not a function :
- TypeError: e[h] is not a function
- TypeError:_12.store.query is not a function
- mongodb 添加用户报错TypeError:db.addUser is not a function
- mongodb 添加用户报错TypeError:db.addUser is not a function (mongodb3.4.1)
- mongodb 添加用户报错TypeError:db.addUser is not a function (mongodb3.4.1)
- mongodb 添加用户报错TypeError:db.addUser is not a function (mongodb3.4.1)
- typeError: form.submit is not a function
- Uncaught TypeError: undefined is not a function
- Uncaught TypeError: string is not a function
- Uncaught TypeError: object is not a function
- TypeError: jQuery(...).validationEngine is not a function
- TypeError: $(...).ajaxSubmit is not a function
- Uncaught TypeError: undefined is not a function
- Uncaught TypeError: undefined is not a function
- Uncaught TypeError: object is not a function
- Uncaught TypeError: boolean is not a function
- Uncaught TypeError: $(...).appendChild is not a function
- Block - 7
- 转EGO 因地制宜选择合适的管理风格
- Flash加载网络图片显示
- Android设备的分辨率
- Android 异步消息处理机制 让你深入理解 Looper、Handler、Message三者关系
- E QUERY [thread1] TypeError: db.foo.batchInsert is not a function :
- 二叉搜索树转换为有序双向链表
- 接口
- iOS - UITextField输入错误的震动动画
- 面试题72:滑动窗口的最大值
- android绑定服务核心代码
- 立 30
- JAVA生成excel表格
- 29、Java中如何将字符串转换为日期类型?