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}])


11 comments:
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

    ReplyDelete
  2. nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this! fake documents generator

    ReplyDelete
  3. This might be more effectively said than done, yet here's the reason it's significant: The distributer controls the nature of the item. Fókuszpályázat

    ReplyDelete
  4. 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

    ReplyDelete

Please do not enter spam links

Services

More Services