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: Won't Do
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Component/s: CRUD
    • None
    • Not Needed
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4669 Won't Do
      CXX-2701 Won't Do
      CSHARP-4687 Won't Do
      GODRIVER-2877 Won't Do
      JAVA-5041 Won't Do
      NODE-5371 Won't Do
      MOTOR-1146 Won't Do
      PYTHON-3768 Won't Do
      PHPLIB-1169 Won't Do
      RUBY-3282 Won't Do
      RUST-1686 Won't Do
      $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 Won't Do CXX-2701 Won't Do CSHARP-4687 Won't Do GODRIVER-2877 Won't Do JAVA-5041 Won't Do NODE-5371 Won't Do MOTOR-1146 Won't Do PYTHON-3768 Won't Do PHPLIB-1169 Won't Do RUBY-3282 Won't Do RUST-1686 Won't Do

      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:
              Resolved: