title: Mongoose insertMany does not work for large array
body: <p>I have been trying to insert large data about(400-1000) json object array to mongodb using <code>mongoose</code> + <code>expressjs</code> When i changed data about(50) items insertMany works great without problem. But if data is more than 100 it giving me an error.</p>
  
  <pre><code>Departed.insertMany(results)
    .then(dep =&gt; {
      console.log(dep)
      res.sendStatus(201)
    })
    .catch(err =&gt; {
      console.log(err)
    })
  </code></pre>
  
  <p>in morgan console i got following:</p>
  
  <pre><code>creation { active: true,
    _id: 5b73e8af19722d1689d863b0,
    name: 'TEST DATA 241',
    map: '',
    created_at: 2018-08-15T08:47:43.196Z,
    updated_at: 2018-08-15T08:47:43.196Z,
    __v: 0 }
  insert read 453
  (node:5769) [DEP0079] DeprecationWarning: Custom inspection function on Objects via .inspect() is deprecated
  </code></pre>
  
  <p>also on client side(chrome, dev tools network tab) status got </p>
  
  <pre><code>(failed)
  net::ERR_EMPTY_RESPONSE
  </code></pre>
  
  <p>I have read mongo's <code>insertMany()</code> has limit about 1000 and i am using mongo 4.0 version. Even i chunked large json into several arrays and tried to insert it but still got same results. Actual snippets are </p>
  
  <pre><code>router.post('/xls', upload.single('file'), async (req, res, next) =&gt; {
    try {
      if (req.body &amp;&amp; req.file) {
        console.log('req', req.file)
        const segments = req.file.originalname.split('.')
        let exceltojson = segments[segments.length - 1] === 'xlsx' ? xlsx : xls
        exceltojson(
          {
            input: req.file.path,
            output: 'output.json'
          },
          async (err, result) =&gt; {
            if (err) console.log(err)
            const section = await Section.create({
              name: req.body.section,
              map: req.body.map
            })
            const results = await result.map(item =&gt; {
              return {
                branch: req.body.branch,
                section: String(section._id),
                ...item
              }
            })
            await console.log('creation', section)
            console.log('insert read', results.length)
            if (results.length &gt;= 100) {
              console.log('more than 100')
              const data = _.chunk(results, 100)
              data.forEach(async chunk =&gt; {
                console.log('foreach')
                Departed.insertMany(chunk)
                  .then(dep =&gt; {
                    console.log(dep)
                    res.sendStatus(201)
                  })
                  .catch(err =&gt; {
                    console.log(err)
                  })
              })
            }
          }
        )
      }
    } catch (error) {
      next(error)
    }
  })
  </code></pre>