I am trying to run a project with 2 MongoDB databases(db1, db2) those are inside a file named dump. I tried the following commands in 2 different terminals inside dump folder:

mongod --dbpath=db1 --port=27017
mongod --dbpath=db2 --port=27018

Or the below command in one terminal outside of the dump folder:

mongod --dbpath=dump

It seems both the ways work with no errors but when I check the project in localhost, it seems databases don't work properly!

How should i run a project with two databases on localhost using Windows10 command line?

There is also a file named config.js in the project with the following code:

module.exports = {
    'db1URL': 'mongodb://localhost:27017/db1',
    'secretKey' : '1111-2222-3333-4444',
    'db2URL': 'mongodb://localhost:27017/db2'