SSH - mongoDB drop DB

Hi

I have the following commands that I need to fire on a remove server, where mongodb is running. I use SSH module for this, with the option to run a shell.
‘mongosh’ → this opens mongoDB ‘shell’
‘use dbname’
‘db.dropDatabase()’
then exit mongodb

When I add each command as 1 item, this times out… I am not sure how else to solve this…?
Since it exits when I use a new SSH module, I somehow have to do it in one go.
Shall I create a shell script and run it…?

Best,
Daniel