Bug #87585 dir(db) shows table names in the output
Submitted: 29 Aug 2017 14:37 Modified: 27 Sep 2017 19:25
Reporter: Shahriyar Rzayev (OCA) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Document Store: MySQL Shell Severity:S2 (Serious)
Version:8.0.0 OS:Any
Assigned to: CPU Architecture:Any

[29 Aug 2017 14:37] Shahriyar Rzayev
Description:
$ mysqlsh root@localhost/generated_columns_test --py

Trying to run dir(db):

mysql-py> dir(db)
[
    "__callmethod__",
    "__class__",
    "__cmp__",
    "__delattr__",
    "__doc__",
    "__format__",
    "__getattribute__",
    "__hash__",
    "__init__",
    "__new__",
    "__reduce__",
    "__reduce_ex__",
    "__repr__",
    "__setattr__",
    "__sizeof__",
    "__str__",
    "__subclasshook__",
    "create_collection",
    "exists_in_database",
    "fff",
    "get_collection",
    "get_collection_as_table",
    "get_collections",
    "get_name",
    "get_schema",
    "get_session",
    "get_table",
    "get_tables",
    "help",
    "my_collection",
    "name",
    "nc",
    "sbtest1",
    "schema",
    "session"
]

As you see it shows, table/collections as well, which will pollute output, if somebody has 100 tables.

How to repeat:
See description
[30 Aug 2017 7:18] Umesh Shastry
Hello Shahriyar,

Thank you for the report.

Thanks,
Umesh
[27 Sep 2017 19:25] Alfredo Kojima
Posted by developer:
 
This is part of the feature of allowing tables to be referenced by name, such as in db.my_collection.find()

If an overview of the methods offered by db is desired, then db.help() might be more suitable.