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
This is my project code… My project is running on 192.168.99.100:4500. when I register button it is not storing data into db. but it is creating empty db…
my dbname is testdb. in that testdb only one collection is created when I run the applicaiton: that is session. If register it is not saving data into that testdb. so, I tried another way like manually created one collection like app_users, app_roles… app_users is the collection which store the registered user details . app_roles is the name which user is allowed to login.(it has userneme and password). using that username and password application is
not opening
I am using passport.js for login credentials purpose is there any problem with that. Because I am unable to register . once I click the register button the data should save in to db. I have created one sample in that data is stored into db. but in my application data is not saved into db. I already shared my project files. can you say the mistake to resolve this type of problem
WARNING (Windows & OS X): The default Docker setup on Windows and OS X uses a VirtualBox VM to host the Docker daemon. Unfortunately, the mechanism VirtualBox uses to share folders between the host system and the Docker container is not compatible with the memory mapped files used by MongoDB (see vbox bug, docs.mongodb.org and related jira.mongodb.org bug). This means that it is not possible to run a MongoDB container with the data directory mapped to the host.
i think this means that mongo does not see the original database stored on the volume
@sdetweil, I have created one sample application to store the data into mongodb. That project is working well, I can insert and see the inserted data in my database. Then why the above project is not work?
can you say that line clearly, reading that line I cant get clearly. what I understood is it will not connect with my mongodb databse. is that correct? If So, I have a sample application to store the data into mongodb then how it is storing?