Hi,
I'm a beginner with MongoDB and I've some questions:
When I'm connected to Mongo, and i execute
show dbs
I see 2 databases:admin
andlocal
. What's their role? Then if I execute an insert command likedb.foo.insert({"value":"mongo"})
, thetest
database appears. Why? How can i specify a custom name for a database?With
show dbs
I get the databases (somehow likeshow databases
in sql), how can I then list the collections inside a database (I would useshow tables
in sql)?When executing a command, the MongoDB tutorial always uses the
db
object. Is it the main object (a sort of "connection" object) that has to used for executing commands or it's something else?
Thanks!