distinct3.js uses the bulk API incorrectly

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • None
    • Fully Compatible
    • ALL
    • Quint Iteration 5
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            Max Hirschhorn
            Reporter:
            Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: