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

JavaScript version() function should return version string

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.3.0
    • Component/s: JavaScript
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change

      Description

      The (native) "version()" function we install for JavaScript prints the version string to stdout and also prints the Git hash if the version string includes a "+". The function then returns "undefined" (which is displayed as "null" in the shell).

      This function would be more useful if it instead returned the version string and let the caller parse it and/or display it if desired.

      MongoDB shell version: 2.1.2-pre-
      connecting to: test
      > var versionString = version(); // prints string instead of returning it
      version: 2.1.2-pre-
      > versionString
      > versionString == null
      true
      >

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: