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

Omit upsert and multi options in update statements by default

    • Type: Icon: Spec Change Spec Change
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: CRUD
    • None
    • Needed

      Summary

      b6cdaa8 originally changed the CRUD spec's documentation for upsert from "default is false" to "default is to not send a value". There is no similar guidance for multi, as the CRUD spec doesn't discuss command construction.

      That said, there were never downstream language tickets for the upsert documentation change. Some drivers (e.g. libmongoc) have historically specified false for both options in outgoing update commands, so not to rely on the server's default. At this point, it is unlikely the server defaults will ever change (it would be a significant BC break), so we should consider requiring drivers to omit these fields by default.

      In turn, this would mean we can remove $$unsetOrMatches for these options throughout our spec tests, and spec test authors will no longer need to remember to use that syntax going forward.

      Motivation

      Who is the affected end user?

      Drivers.

      How does this affect the end user?

      Outgoing update commands are more verbose and spec test authors must remember to use $$unsetOrMatches for update command assertions.

      Is this issue urgent?

      No.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      No.

            Assignee:
            Unassigned Unassigned
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: