After setting db to some arbitrary value, i am not able to perform any operation in shell.
Is it know bug or expected behavior?
> use tutorial
switched to db tutorial
> db
tutorial
> db = 5
5
> db
5
> show dbs
Fri Mar 23 17:18:40 TypeError: db.getMongo is not a function shell/utils.js:1235
>
> use tutorial
Fri Mar 23 17:18:55 TypeError: db.getMongo is not a function shell/utils.js:1167
> db = 'tutorial'
tutorial
> show dbs
Fri Mar 23 17:19:38 TypeError: db.getMongo is not a function shell/utils.js:1235
The Mongo Interactive Shell is a Javascript Shell, and hence it obeys all laws of a Javascript Shell. You are overriding the db variable that got initialized during startup.