MongoDB Client > Invalid Operation, no operations specified

Viewed 3094

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

1 Answers

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

Related