Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-6919

db.collection(collectionName).removeOne() not working as expected

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: None
    • Component/s: manual, Server
    • Labels:
    • Environment:

      var MongoClient1 = require('mongodb').MongoClient;
      MongoClient1.connect("mongodb://localhost:27017/test", function(err, db) {
      if(err)console.log("err",err)
      //this is not working but deleting all records
      db.collection(colName).removeOne({ "del" : "true" },1,function(){
        db.close()
      })
      //this is working good and deleting only first record.
      db.collection(colName).removeOne({ "del" : "true" },function(){
        db.close()
      })
      

            Assignee:
            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            Reporter:
            xgen-internal-docs Docs Collector User (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              6 years, 24 weeks, 4 days ago