Not able to use createIndex in mongosh

TypeError: is not a function

Getting this error in Mongosh

In the shell (and this is true both for the legacy mongo as well as for mongosh) the help property of most objects is special as it is used for the integrated contextual help. If in mongosh you do or the shell prints out the help content for the database class.

To get around that, you can do:


Thank you so much for the root cause …it was confusing when the command did not work , :smiley:
your solution worked …we have just started on Mongodb, will probably change the collection name.
Thanks again

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.