AppleScript App to connect to Atlas MongoDB Instance

Viewed 10

I've written an AppleScript script that, amongst other stuff, restores a MongoDB collection to Atlas using MongoRestore CLI called as a shell script.

This works perfectly as a script run from the editor but when saved as a stand alone application I get a weird error:

error parsing command line options: error parsing uri: lookup _mongodb._tcp.missing on X.X.X.X:53: no such host 2022-09-06T21:31:18.249+0100 try ‘mongorestore --help’ for more

X.X.X.X is the IP of my router on my network.

To me is seems like perhaps, for some reason, MongoRestore might be processing the command differently in the 2 different calling scenarios. The command is:

/opt/homebrew/bin/mongorestore --uri mongodb+srv://" & psMongoDBUser & ":" & psMongoDBPassword & "@" & msMongoDBCluster & ".mongodb.net " & mongoFile

The instructions I was following are: https://www.mongodb.com/docs/atlas/import/mongorestore/ . There is a known DNS issue with that approach using Ubuntu 18.04 so perhaps I’m hitting that via the App but not the script directly? Unfortunately I've not been successful in trying to connect to Atlas via the workaround given in the known issue.

Any suggestions please?

0 Answers
Related