Node.js delete query for "mongodb"
<p>I have been trying to understand why this delete query doesn't work for days, and I just can't see the problem. <br>
I've tried many different delete queries like deleteOne, findOneAndDelete, deleteMany but none of them worked. <br>
I use the "mongodb" client for node.js</p>

<pre><code>mongo.connect(serverAddress, (err, db) =&gt; {
//(db connection is ok, server can find and create documents)

    var doc = db.collection('myCollection'),
    docToDelete = "575807172154b7a019ebf6db"; 
    //I can see the same document id on my database

    doc.deleteOne({"_id":docToDelete}, (err, results) =&gt; { 
        console.log(`Request success : ${results.result.ok}, documents deleted : ${results.result.n}`);
        //Request success : 1, documents deleted : 0, the document is still on my database
    });
}
//the doc var is the same I use to add/find documents (and it works).
</code></pre>

<p>When I use the same query in softwares like MongoClient, it works. <br>
I have tried many solutions posted on this site and sorry if the error is too obvious but I'm totaly lost.<br>
Thanks for your help.</p>