I am developing an application (on Java) that works with files on an external hard drive. There is also a Mongo database. I want the database to be on an external hard disk (in the same place as the files) and the program can work with it on "any" computer to which this disk was connected.
Tell me, please, how can I specify the path to the database files when connecting to it?
Now I connect to the database like this:
mongoClient = new MongoClient(new MongoClientURI("mongodb://localhost:27017")); database = mongoClient.getDatabase("baseName"); but in this case, the mongo independently determines the storage location of the database.