Problems and doubts in beginner learning MongoDB

MongoDB MongoDB3.x 4.0 

1. First of all, run the test directory under the mongod-- dbpath c:\ test C disk through cmd. After running, there are a large number of files in the c:test directory. According to the saying, the startup data at this time

2. Then open a new cmd window and run mongo= > use testdb = > db.student.insert ({"name": "helloworld"}); prompt that a piece of data has been successfully inserted and the testdb database has been created. The data {"name": "helloworld"} can be successfully queried through the find statement

.

there are several problems:
1. The tutorial mentioned that the database of mongoDB is physically visible, but I didn"t find the testdb.ns file in c:\ test. Is there a difference between version 3.0 and version 4.0? If so, where is the testdb database file I created in 4. 0?

2. The tutorial says that the first cmd window [mongod-- dbpath c:\ test this] hangs after running. You can"t close this window. You must keep it running, or you won"t be able to access the database. But in practical use, I close the first window and mongo= > use testdb = > db.student.insert ({"name": "helloworld2"}) in the new cmd as usual; everything works normally, including after I shut down and restart, when I open only one cmd window to query through find, all the data is written normally. Is this also the difference between 3.0 and 4.0? If so, what"s the use of mongod? Because after I restart my computer, I will directly mongo= > use testdb. All normal operations

when you open 3.MongoVUE, you can see the database such as testdb, but you can"t open the specific collection collection. [clicking the add, delete, check and modify buttons on the unresponsive menu is grayed out unavailable]? What"s the reason for this? [solved, MongoVUE"s own problem seems to be that the engine only supports the old 2.x mongoDB, OK after installing the recommended Studio 3T]

Thank you in advance ~

Oct.27,2021

problem solved. The video is true, but now I installed it for the first time and then I executed mongod-dbpath c:test, and at that time there was a mongod process that was already in memory and closed in time to change the window. The service is actually still running, so a separate window running cm can also operate on the database. Later, I found mongod in the process panel. after the process is over, a cmd will not be able to access the database through mongo, and the database files are indeed stored in c:test, but without version 3.0 of testdb.ns, it is not clear to write in taking a file. If you choose another path through mongod-- dbpath at this time, show dbs will not have the testdb database, which means that the file is indeed written in the c:test directory

.
Menu