I have an own deployed MongoDB which is the database of my parse server. Parse server requires a DATABASE_URI
and I pass mongodb://user:password@mongodb:27017/main?authSource=admin&authMechanism=SCRAM-SHA-1
to it and I'm able to save data from my android client to database. I've changed only the username and password than the real URI and the rest is exactly the same. But when I try to connect to my MongoDB from MongoDB Compass or similar tools, I get connection refused error. Since my parse server and my MongoDB are deployed on the same server, it seems that I should change the mongodb
part of the DATABASE_URI
, after @ and before : . But I can not find the correct subdomain or host name or IP
address so I still get the connection refused error. My question is, is there a command to get the IP
address of MongoDB server in MongoDB shell, or anything I can replace with the host name in URI?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…