MongoDB Create a Database and Collection
kodingwindow@kw:~$ mongosh
...

test> show databases
admin    40.00 KiB
config  108.00 KiB
local    40.00 KiB

test> use DB
switched to db DB

DB> db
DB

DB> db.getName()
DB

DB> db.createCollection("holders")
{ "ok" : 1 }

DB> db.getCollectionNames()
[ "holders" ]

DB> show dbs
DB        8.00 KiB
admin    40.00 KiB
config  108.00 KiB
local    40.00 KiB
Advertisement