TypeError: documents.map is not a function DBCollection.prototype.insertMany@src/mongo/shell/crud_api.js:295:1

Error: E QUERY    [thread1] TypeError: documents.map is not a function :

If you are facing this error while insert multiple records in mongodb, Please check syntax carefully.
Don't enter in trap of mongo db version. insertMany is supported from version 3.2

Your command was : without square bracket, I have added below and now this will work

db.emp.insertMany ([{"id":4 ,"name":"Mradul sahai", "dept":2},{"id":3, "name":"Rakesh Sharma", "dept":2}])

Write comments
  1. This article is an appealing wealth of useful informative that is interesting and well-written. I commend your hard work on this and thank you for this information. I know it very well that if anyone visits your blog, then he/she will surely revisit it again. Website translation into another language service

  2. This is my first visit to your web journal! We are a group of volunteers and new activities in the same specialty. Website gave us helpful data to work. craniocerical instability


Please do not enter spam links


More Services