mongosh¶
manage mongodb using the command line
mongosh¶
mongosh
is the tool to work with mongodb on the CLI
list databases¶
show collections¶
first open the database, then show the collections
database backup¶
backup all databases:
kubectl exec -it --tty mongodb-foo-bar -- sh -c '/usr/bin/mongodump --compressors=zstd --archive' | zstd - -o mongodb_$(date +%F).zst
backup just mydb
: