Uploaded image for project: 'C++ Driver'
  1. C++ Driver
  2. CXX-1554

Expose server version value type

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Not planned
    • Component/s: Testing
    • Labels:
      None

      Description

      We have a number of places in the code (all in tests and examples) that check the server version (grep for get_server_version).

      This code

      1. relies on string-comparison (isn't really semver compliant)
      2. probably is not what we'd want users to actually do if they have server-version-dependent code-paths

      Instead we could support a mongocxx::version value-type or something that a client could expose:

      mongocxx::version minimum {3,6,0};
      mongocxx::version actual = client.server_version();
      if (actual < minimum) {
          throw std::logic_error("Server version " + actual + " < minimum " + minimum);
      }
      

      (Just an idea I had - fine to resolve if others don't see the value or if there's a better alternative.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ryan.timmons Ryan Timmons
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: