How to switch database
See original GitHub issueIn the mongo shell, I can do like this:
use admin
db.auth('user','pass')
use test
db.find()
This means I pass the authurized then I can do everything.
My problem is how can I do the same work in mongoose, how can I switch db in mongonse?
Because I must enter the ADMIN db to authurize, and then chang to other db to my own manipulation
Issue Analytics
- State:
- Created 11 years ago
- Comments:10
Top Results From Across the Web
How to switch databases in psql? - postgresql - Stack Overflow
Run psql in command line, it will switch to default database; psql anotherdb , it will switch to the db with the name...
Read more >Listing and Switching Databases in PostgreSQL - Liquid Web
Step 1: Login to your Database · Step 2: Enter the PostgreSQL environment · Step 3: List Your PostgreSQL databases · Step 4:...
Read more >Example of Postgres Switch Database - eduCBA
We can switch between the databases in PostgreSQL using \c or \connect metacommand, which creates a new connection and closes the current one....
Read more >Switch databases in PostgreSQL with `\connect`
Postgres has a different way to switch databases, you do so using one of its meta-commands. Once you are in the Postgres terminal,...
Read more >SWITCH - Database - Oracle Help Center
A SWITCH is equivalent to the SQL statement ALTER DATABASE RENAME FILE : the names of the files in the RMAN repository are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
other possible way is with query param in url
look here -> Support AuthSource
Had problem to connect to a mongodb - coz the auth would bring me to a specific db like “admin” (standard). But how with mongoose? Only set the authSource inside of auth option…