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

MongoSH throw error when printing Proxy object

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • No version
    • Affects Version/s: None
    • Component/s: Embedded Shell
    • None
    • Not Needed

      Problem Statement/Rationale

      I have been using the customize DBs object that can access databases via its fields. It works normally in legacy mongo shell but keep getting error in MongoSH.

      Steps to Reproduce

      Using the dbs.js file in the attachment. Then load the object via require.

      dbs = require('./dbs')(db)

      Expected Results

      Print the object normally or print nothing.

      Actual Results

      Uncaught:
      MongoshInternalError: [COMMON-90001] str.match is not a function
      This is an error inside mongosh. Please file a bug report for the MONGOSH project here: https://jira.mongodb.org/projects/MONGOSH/issues.
      Please include the log file for this session (C:\Users\<me>\AppData\Local\mongodb\mongosh\612365b3292c9fb72606a267_log)

      Additional Notes

      Any additional information that may be useful to include.

        1. 612365b3292c9fb72606a267_log-1
          14 kB
        2. dbs.js
          2 kB

            Assignee:
            Unassigned Unassigned
            Reporter:
            bdtri.cse.hcmut@gmail.com Billy Bùi
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: