MongoDB commands

A list of useful MongoDB commands
MongoDB
cli
linux
Published

March 26, 2021

Connect to mongo using SSL certificates

mongo --host hostname --port 27027 -ssl --sslPEMKeyFile /path/to/file --sslCAFile /path/to/file

Login as admin user

use admin
db.auth('user','passwd')

show databases

show databases

show collections

show collections

explore collections

db.collectionname.find()