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

Add static helpers to Mongo class that point to instance methods

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: UI / UX
    • None
    • 2
    • Developer Tools

      https://mongodb.slack.com/archives/CUHC9R8J0/p1708945011309839

      Users who read the docs pages (and skip over the examples section) could assume that they can run code like Mongo.getDBs(), when in reality they'd want db.getMongo().getDBs(). We could add/generate a set of static helper methods for Mongo that throws helpful errors, e.g. have Mongo.foo() throw something along the lines of Error: No such method `Mongo.foo()`. Did you mean `db.getMongo().foo(…)`?.

      We'd probably want to make sure that these methods do not end up included in autocomplete results.

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

              Created:
              Updated: