Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-2638

Add spec tests for passing empty pipeline arrays to update and findAndModify operations

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Component/s: CRUD
    • Labels:
      None
    • Needed
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4669 Blocked
      CXX-2701 Blocked
      CSHARP-4687 Blocked
      GODRIVER-2877 Blocked
      JAVA-5041 Blocked
      NODE-5371 Blocked
      MOTOR-1146 Blocked
      PYTHON-3768 Blocked
      PHPLIB-1169 In Progress
      RUBY-3282 Blocked
      RUST-1686 Blocked
      $i18n.getText("admin.common.words.show")
      #scriptField, #scriptField *{ border: 1px solid black; } #scriptField{ border-collapse: collapse; } #scriptField td { text-align: center; /* Center-align text in table cells */ } #scriptField td.key { text-align: left; /* Left-align text in the Key column */ } #scriptField a { text-decoration: none; /* Remove underlines from links */ border: none; /* Remove border from links */ } /* Add green background color to cells with FixVersion */ #scriptField td.hasFixVersion { background-color: #00FF00; /* Green color code */ } /* Center-align the first row headers */ #scriptField th { text-align: center; } Key Status/Resolution FixVersion CDRIVER-4669 Blocked CXX-2701 Blocked CSHARP-4687 Blocked GODRIVER-2877 Blocked JAVA-5041 Blocked NODE-5371 Blocked MOTOR-1146 Blocked PYTHON-3768 Blocked PHPLIB-1169 In Progress RUBY-3282 Blocked RUST-1686 Blocked

      Summary

      An empty pipeline array is a NOP for both update and findAndModify. The current CRUD spec tests for update pipelines only use non-empty pipeline arrays. We should test this to assert that drivers don't prohibit users from specifying an empty array (despite there being little reason to do so).

      Consider:

      > db.runCommand({ update: "foo", updates: [ { q: { _id: 1 }, u: [] } ] })
      
      > db.runCommand({ findAndModify: "foo", query: { _id: 1 }, update: [] })
      

      Motivation

      Who is the affected end user?

      Users wishing to execute NOP pipelines.

      How does this affect the end user?

      Users are potentially blocked if a driver happens to reject an empty pipeline.

      How likely is it that this problem or use case will occur?

      Very rare.

      If the problem does occur, what are the consequences and how severe are they?

      Drivers may potentially reject a valid pipeline argument.

      Is this issue urgent?

      No.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      Yes.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Andreas Braun Andreas Braun
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: