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

Any collection name on db w/corresponding function name fail

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Shell
    • Labels:
      None
    • Operating System:
      ALL

      Description

      For example the config.version collection in sharding config is not accessible from the shell since the version function is returned.

      We should check if the collection exists before returning the function:

      > use config
      switched to db config
      > db["version"].find()
      Wed Mar 16 08:23:22 TypeError: db.version.find is not a function (shell):1
      > db["version"]
      function ()

      { return this.serverBuildInfo().version; } If there is a collection we should use that, and print a warning message about the naming conflict. $ mongoexport -d config -c version connected to: 127.0.0.1:37017 { "_id" : 1, "version" : 3 }

      exported 1 records

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-platform DO NOT USE - Backlog - Platform Team
              Reporter:
              scotthernandez Scott Hernandez
              Participants:
              Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: