Mongodb

From Halfface
Jump to navigation Jump to search

connect

mongo

run command(list cluster information)

mongo --ssl --host mongo.inter.net --quiet -u admin -p P@ssW0rd --authenticationDatabase admin --eval 'rs.status();'

list databases

show dbs
rs.slaveOk();db.adminCommand('listDatabases')

mongodump

mongodump -ssl --host "database/mongo.inter.net" -u username -p P@ssw0rd --authenticationDatabase admin --db "database" -out=/tmp/database_2020-10-20"