Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-52846

Get rid of the old-style (getLastError-requiring) methods on DBDirectClient

    • Fully Compatible
    • Sharding EMEA 2021-10-18, Sharding EMEA 2021-11-01

      DBDirectClient inherits from DBClientBase and as a result it picks up several write methods, which do not return any errors nor results and the caller is supposed to use getLastError afterwards in order to know what happened. Specifically these are: insert/update/delete and most likely create/dropIndexes.

      This is very error prone, because user of this class can accidentally not check, expecting an exception to be thrown on error, but instead they get nothing and the method silently fails.

      As part of this ticket, these methods should be removed and instead a more modern replacement should be introduced, which invokes commands under the hood and throws proper errors, similar to here.

            Assignee:
            allison.easton@mongodb.com Allison Easton
            Reporter:
            kaloian.manassiev@mongodb.com Kaloian Manassiev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: