title: router.delete returns empty array
body: <p>I'm trying to add a function that deletes a record in MongoDB by the id, but I'm getting an empty array as a result and the record is not deleted.</p>
  
  <p>Here is my code so far:</p>
  
  <pre><code>//router
  router.delete('/comandas/:id', (req, res) =&gt; {
    deleteLine(req.params.id)
    res.status(500).end()
    });
  });
  </code></pre>
  
  <pre><code>//delete function
  const objectId = require('mongodb').ObjectID;
  
  const init = () =&gt;
    MongoClient.connect(connectionUrl, { useNewUrlParser: true, useUnifiedTopology: true }).then((client) =&gt; {
      db = client.db(dbName)
    })
  
  const deleteLine = (id) =&gt; {
    const collection = db.collection('comanda')
    return collection.deleteOne({"_id": objectId(id)})
  }
  </code></pre>