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

Simplify transaction options in convenient API doc example code

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Component/s: Docs Examples
    • Labels:
      None
    • Needed
    • Hide

      Teams will need to update their documentation examples for transactions. After each language ticket is merged, the assignee should then open a new DOCSP ticket with a "Server" component to inform the docs team to pull in the updated examples.

      The above pertains to language-specific examples that are rendered in the MongoDB manual. Any docs owned by the language team can be directly updated.

      Show
      Teams will need to update their documentation examples for transactions. After each language ticket is merged, the assignee should then open a new DOCSP ticket with a "Server" component to inform the docs team to pull in the updated examples. The above pertains to language-specific examples that are rendered in the MongoDB manual. Any docs owned by the language team can be directly updated.
    • $i18n.getText("admin.common.words.hide")
      Key Status/Resolution FixVersion
      CDRIVER-4618 Backlog
      CXX-2679 Backlog
      CSHARP-4620 Done
      GODRIVER-2814 Backlog
      JAVA-4945 Duplicate
      NODE-5210 Backlog
      MOTOR-1123 Backlog
      PYTHON-3674 Backlog
      PHPLIB-1120 Fixed 1.16.0
      RUBY-3243 Backlog
      RUST-1637 Fixed 2.6.0
      $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-4618 Backlog CXX-2679 Backlog CSHARP-4620 Done GODRIVER-2814 Backlog JAVA-4945 Duplicate NODE-5210 Backlog MOTOR-1123 Backlog PYTHON-3674 Backlog PHPLIB-1120 Fixed 1.16.0 RUBY-3243 Backlog RUST-1637 Fixed 2.6.0

      Summary

      What is the problem or use case, what are we trying to achieve?

      The Convenient API for Transactions examples in the MongoDB manual use the following options:

      • "local" read concern
      • "primary" read preference
      • "majority" write concern with wTimeoutMS=1000

      These no longer seem relevant and I propose removing them.

      • The "local" read concern is already the default.
      • The callback function is only executing write operations so a read preference is unnecessary
      • Atlas connection strings include w=majority by default, although perhaps we'd want to keep that in place for non-Atlas users.
      • I don't know what the purpose of wTimeoutMS is here, or why we'd want to invite a replication timeout

      This came up while reviewing the Unit 2 Lesson 6 script for upcoming PHP courses, which copied with_transaction() examples from
      https://www.mongodb.com/docs/manual/core/transactions/.

      Motivation

      Who is the affected end user?

      Documentation readers.

      How does this affect the end user?

      The documentation may be unnecessarily verbose.

      Is this issue urgent?

      No.

      Is this ticket required by a downstream team?

      The docs team would need to be informed to republish language examples after drivers implement this change.

      Is this ticket only for tests?

      Yes (since documentation examples are run in driver test suites).

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

              Created:
              Updated: