Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18754

distinct3.js uses the bulk API incorrectly

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • None
    • Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • Quint Iteration 5

    Description

      The code evaluated in the parallel shell does not use the bulk API correctly.

      var bulk = db.jstests_distinct3.initializeUnorderedBulkOp();
      for( i = 0; i < 100; ++i ) {
          bulk.remove( { a:49 } );
          for( j = 0; j < 20; ++j ) {
              bulk.insert( { a:49, c:49, d:j } );
          }
          bulk.execute();
      }
      

      1. It should be .find({a: 49}).remove() instead of .remove({a: 49}).
      2. A bulk operation cannot be reused, so bulk should be initialized inside the for loop.

      Attachments

        Activity

          People

            max.hirschhorn@mongodb.com Max Hirschhorn
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: