Using MongoDB Command-Line Tools

1. Using mongodump Utility

FlagDetail
--uriConnection string
--archive --gzipCompressed single-file dump
--oplogPoint-in-time consistency

2. Using mongorestore Utility

FlagDetail
--dropDrop before restore
--nsFrom / --nsToRename during restore
--numParallelCollectionsConcurrency

3. Using mongoexport Utility

FlagDetail
--typejson|csv
--queryFilter
--fieldsRequired for CSV

4. Using mongoimport Utility

FlagDetail
--modeinsert|upsert|merge|delete
--upsertFieldsMatch fields for upsert
--numInsertionWorkersParallelism

5. Using mongostat for Real-Time Monitoring

mongostat --uri="$URI" --discover 2

6. Using mongotop for Read/Write Activity

mongotop --uri="$URI" 5

7. Using mongofiles for GridFS Operations

SubcommandDetail
put / getUpload / download
list / searchBrowse files
deleteRemove by filename

8. Using bsondump for BSON Conversion

bsondump --type=json users.bson > users.json

9. Using mongoreplay for Traffic Recording

StatusDetail
DeprecatedRemoved from mainline tools
Use insteadAtlas Query Profiler / FTDC for capture

10. Understanding Tool Authentication Options

FlagDetail
--username / --passwordBasic auth
--authenticationDatabaseWhere the user is defined
--authenticationMechanismSCRAM-SHA-256, MONGODB-X509, GSSAPI, PLAIN, MONGODB-AWS
--tls* flagsTLS configuration