【发布时间】:2020-08-18 15:53:39
【问题描述】:
db.col.insertMany(
[
{
"_id" : "tt0084726",
"title" : "Star Trek II: The Wrath of Khan",
"year" : 1982,
"type" : "movie"
},
{
"_id" : "tt0796366",
"title" : "Star Trek",
"year" : 2009,
"type" : "movie"
},
{
"_id" : "tt0084726",
"title" : "Star Trek II: The Wrath of Khan",
"year" : 1982,
"type" : "movie"
}
]
);
操作系统:LinuxMint 17.3 Rosa MongoDB:数据库版本 v2.6.12
我正在参加University of MongoDB 的课程。当我将上述命令输入 mongo shell 时,会出现错误:TypeError: Property 'insertMany' of object test.col is not a function
如何解决?我已阅读文档但仍然失败。
【问题讨论】:
-
你用的是什么版本的mongo?
-
MongoDB shell 版本:2.6.12
-
请使用该链接您可以找到详细信息:stackoverflow.com/a/68662249/10936485
标签: javascript mongodb