Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-661

Use Mongo constructor to create initial connection

    XMLWordPrintable

Details

    • Task
    • Status: Open
    • Minor - P4
    • Resolution: Unresolved
    • None
    • None
    • None
    • Not Needed

    Description

      We currently have connection initiation code in two main places, namely, the Mongo constructor/.connect() method and the CliRepl .start() method.

      This leads to problems when there’s discrepancies (like this) between the two.

      One solution would be to use the Mongo constructor to create the first connection always, and not perform connection management inside the cli-repl package (i.e. always create a nodb-style shell first). This probably mirrors what the old shell did a bit more closely as well.

      If we can do it, I think this is worth it, although the fact that we don’t allow creating connections in non-CLI environments might end up being problematic here.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              anna.henningsen@mongodb.com Anna Henningsen
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: