I'm trying to list all the databases while working inside some 'abc' database using javascript. my admin username is 'xyz' and password is 'abc'. But it is displaying an error- error: uncaughtException: Mongo is not defined. can anyone guide me for the same? thanx.
From the console you can simply run show dbs
If you need the output in a Javascript object, try db.adminCommand('listDatabases')
Actually the problem was with authentication of db. The mongo I'm using requires admin authentication before querying or trying any command to process data. I inserted code to authenticate db and got access to db.admin() function of mongodb.
By the way thanx to @arcyqwerty and @Amadan for your support.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With