Ravi Teja Muddada
Ravi Teja Muddada

Reputation: 391

is there any way to run mongo scripts without having mongo shell installed?

Currently , I have an java mongo connector app that connects to mongo database and inserts a json file content into database. I am planning to achieve the same using mongoimport command as part of a script .I would like to check is there any way that we can run mongo scripts without having mongo shell installed on the machine?

Upvotes: 0

Views: 429

Answers (2)

Ravi Teja Muddada
Ravi Teja Muddada

Reputation: 391

I am answering my question mongoimport is part of the database tools package (which includes mongoimport, mongoexport, mongodump and mongorestore). You can find packages for all the operating systems here: https://www.mongodb.com/try/download/database-tools.

So the bottom line is in order to run mongo shell commands atleast machine need to have mongo database tools installed

Upvotes: 0

D. SM
D. SM

Reputation: 14520

To interact with MongoDB server you need some sort of a client that speaks the MongoDB wire protocol. The shell (technically, either of the two shells as of 5.0) is one such client. An application you write that uses a MongoDB driver is also a client that would work.

Since the wire protocol is binary, simple tools like netcat aren't going to work.

If the server allows remote access, you can use a client on any of the machines that is allowed to access the server.

Upvotes: 1

Related Questions