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

JavaScript version() function should return version string

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.3.0
    • Affects Version/s: None
    • Component/s: JavaScript
    • Labels:
      None
    • Minor Change

      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
      >
      

            Assignee:
            spencer@mongodb.com Spencer Brody (Inactive)
            Reporter:
            tad Tad Marshall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: