How to show current db name?

When I Connect MongoDB that is created by myself, just show ‘>’,
But, When I connected MongoDB that is created by atlas, show

like current DB Name >

Prompt setup?

How can I setup like added image?
Screen Shot 2022-03-22 at 5.58.25 PM

1 Like

What shell are you using? I’d recommend using mongosh which you can download from MongoDB Shell Download | MongoDB.

With that, this is what the default prompt look like:

Connected to Atlas:
image

Connected to standalone node on localhost:
image

You can also get a fancier prompt.

Here is an example connected to Atlas reading from an analytics node:
image

And here is what it looks like connected to localhost:
image

If you are interested to see how to set that up, take a look at this blog I posted yesterday: MongoDB Shell tips and tricks - DEV Community

3 Likes

Wow! Thanks a lot~

I can unserstand.

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