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

JavaScript version() function should return version string

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.3.0
    • None
    • JavaScript
    • None
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: