最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - MongoDB Client > Invalid Operation, no operations specified - Stack Overflow

programmeradmin4浏览0评论

NPM Library: "mongodb": "3.1.4"

I get the following error, when trying to bulk insert a list of data:

Code:

db.collection('products').insertManyAsync(products, {ordered: false})

Error:

Invalid Operation, no operations specified

NPM Library: "mongodb": "3.1.4"

I get the following error, when trying to bulk insert a list of data:

Code:

db.collection('products').insertManyAsync(products, {ordered: false})

Error:

Invalid Operation, no operations specified

Share Improve this question asked Sep 5, 2018 at 7:38 Nick GrealyNick Grealy 26k9 gold badges111 silver badges126 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Simple solution (but I couldn't find it listed anywhere), it turns out the products array was empty, which causes the error.

发布评论

评论列表(0)

  1. 暂无评论