mongodump and restore in single command How to perform mongo DB dump and restore in a single command, by providing source and sink DB and collection name separately?

I understand we can do mongodump and then mongorestore but if I need to this on an intermediate machine, this will mean I will need to wait for mongodump to complete before I can start mongorestore manually again. Is there a way to do it in a single command?
You mean like this:
mongodump --archive --db=test --port=27017 | mongorestore --archive --port=27018