Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1225

Find.updateOne returns FindOperatorsUnordered instead of UnorderedBulkOperation

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.0
    • Affects Version/s: 3.0.0, 2.2.33
    • Component/s: None
    • Environment:
      Node 8.9.1

      Unlike the doc stated, the following code returns FindOperatorsUnordered instead of UnorderedBulkOp

      const { MongoClient } = require('mongodb');
      
      const url = 'mongodb://localhost:27017';
      
      const dbName = 'dbname';
      
      MongoClient.connect(url, (err, client) => {
        console.log('Connected successfully to server');
      
        const db = client.db(dbName);
      
        const batch = db.collection('Products').initializeUnorderedBulkOp();
      
        console.log(batch.find({ code: 1 }).updateOne({ change: true }));
        console.log(batch);
      });
      

            Assignee:
            daniel.aprahamian@mongodb.com Daniel Aprahamian (Inactive)
            Reporter:
            Weng Kerwin [X]
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: