[SERVER-22022] Tab completing ObjectId objects doesn't work Created: 29/Dec/15  Updated: 06/Dec/22  Resolved: 03/Dec/21

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.2.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kevin Pulo Assignee: Backlog - Server Tooling and Methods (STM) (Inactive)
Resolution: Won't Fix Votes: 1
Labels: move-stm
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Server Tooling & Methods
Operating System: ALL
Participants:

 Description   

Trying to use tab completion to see the available member functions an ObjectId no longer works.

3.2.0 and 3.2.1-rc0 (broken):

$ /m/3.2.1-rc0/bin/mongo --norc
MongoDB shell version: 3.2.1-rc0
connecting to: test
> foo = ObjectId()
ObjectId("56821a6f4a438b568c340b3b")
> foo.<Tab>exception during autocomplete: "Cannot call \"getter\" on prototype of \"ObjectId\""
<Tab>exception during autocomplete: "Cannot call \"getter\" on prototype of \"ObjectId\""
<Enter>  foo.
...<Enter>
...<Enter>
> shellAutocomplete("foo."); printjson(__autocomplete__)
exception during autocomplete: "Cannot call \"getter\" on prototype of \"ObjectId\""
[ ]
>

3.0.8 (expected behaviour):

$ /m/3.0.8/bin/mongo --norc
MongoDB shell version: 3.0.8
connecting to: test
> foo = ObjectId()
ObjectId("56821a1322aec7582e7b4f0b")
> foo.<Tab><Tab>
foo.constructor            foo.getTimestamp(          foo.isObjectId             foo.str                    foo.toString(              foo.valueOf(
foo.equals(                foo.hasOwnProperty(        foo.propertyIsEnumerable(  foo.toLocaleString(        foo.tojson(
> foo.<Enter>
... <Enter>
... <Enter>
> shellAutocomplete("foo."); printjson(__autocomplete__)
[
        "foo.constructor",
        "foo.equals(",
        "foo.getTimestamp(",
        "foo.hasOwnProperty(",
        "foo.isObjectId",
        "foo.propertyIsEnumerable(",
        "foo.str",
        "foo.toLocaleString(",
        "foo.toString(",
        "foo.tojson(",
        "foo.valueOf("
]
>



 Comments   
Comment by Brooke Miller [ 03/Dec/21 ]

We've deprecated the mongo shell in favor of the new mongosh. Unfortunately, we aren't able to pursue improvements to the deprecated shell except in extreme cases, such as critical security fixes. Please start making use of mongosh and let us know if it works for you in this case.

Generated at Thu Feb 08 03:59:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.