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

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

    XMLWordPrintableJSON

Details

    • Task
    • Status: Scheduled
    • Minor - P4
    • Resolution: Unresolved
    • None
    • CRUD
    • None
    • Needed

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: