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

  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

  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

  5. It was thinking about whether I could utilize this review on my other site, I will interface it back to your site though.Great Thanks. maps129

  6. Thanks for sharing the post.. parents are worlds best person in each lives of individual..they need or must succeed to sustain needs of the family. https://maps.lol/petco-us-nd-11228

  7. Big data is a term that describes the large volume of data – both structured and unstructured – that inundates a business on a day-to-day basis. big data projects for students But it’s not the amount of data that’s important.Project Center in Chennai

    Python Training in Chennai Python Training in Chennai The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training Project Centers in Chennai


Please do not enter spam links


More Services