[DOCS-7472] Comment on: "show dbs" Created: 20/Mar/16 Updated: 03/Nov/17 Resolved: 24/Mar/16 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 01112017-cleanup |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Docs Collector User (Inactive) | Assignee: | Ravind Kumar (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | collector-298ba4e7 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System = Windows 8.1 32 bit (Virtual Box) Location: https://docs.mongodb.org/manual/reference/mongo-shell/ |
||
| Participants: | |
| Days since reply: | 7 years, 47 weeks, 2 days ago |
| Description |
|
I am new to mongodb currently I'm learning from docs and tutorials available online, I need a clarification in certain Mongodb 'show dbs' command. I'm pretty sure that it would list all the databases that we've created. but there is a slight problem I'm facing with that command I tried several time but the result is same, I searched about this similar problem in the internet I got two solutions which worked for me Though it worked fine I just need to know why its not refreshing in the real time, is it a feature or a bug, if its a feature I just need to know why and if I am not doing something right please educate me. I'm so much fascinated to learn mongodb completely. Thank you so much in advance |
| Comments |
| Comment by Ravind Kumar (Inactive) [ 21/Mar/16 ] |
|
Hello Sundar, The use db command switches to the database whether it exists or not. The database exists only after a collection is created within it. The relevant paragraph can be found in this section
The db.createCollection() method creates a collection within the current active database. You can also use the db.collection.insertOne or db.collection.insertMany methods to create the collection as a part of the insertion process. Please let us know if this answers your question. We're happy to hear about your interest in MongoDB. If you haven't already, check out https://university.mongodb.com/ for lessons on using MongoDB. The M101 courses are a good place to start. |