I am trying to run my application in docker container. When I connect with my system db using docker-compose it is not connecting with existing db data. rather than it is creating same db with empty collection. and also deleting existing collection on the same db which is exists in my system.
For example: I am having sample_db in my system. I am using that db to run and connect with the application. mongoose.connect(“mongodb://mongo:27017/sample_db”) .
In my sample_db I have lots of collection. when I try to connect and run in docker-machine docker-compose up -d --build command application is running in docker-machine ip with allocated port(192.168.99.100:4200) my application has register page.
when I enter all details to click register button it should store into app_users collection. But it is not storing in to collection. I checked my system db. in that also all existing app_users data are get deleted. Even when I enter the data manually in db. application is not responding.
Why it is deleting window system database existing collections. Why it is not storing data into database