Docker not create database in MongoDB

Hello everyone,
I try to connect Docker to Mongodb compass, when I run “docker run --name mdb -d -p 27017:27017 mongo” and run my nodejs app, it doesn’t create the new database in MongoDbCompass although there no error connect. But when I stop the container mdb and start my app, it create the new DB. Does anyone know how to fix it ?

Isn’t Compass the GUI for MongoDB?

Yes, I mean it didn’t create a new db when I run my code, It did create when I stop a container connect to mongo