mongo < file_with_commands.txt
See also
- MongoDB: MongoDB Compass,
mongo
, mongodump, mongorestore
, mongoexport
, MongoDB changelog, MongoDB Enterprise Kubernetes Operator, GridFS, MongoDB Atlas, MongoDB replication, Ops Manager, docker logs mongodb, show collections, show dbs, mongo --help