Your data disappears because you’re running MongoDB with --rm, which deletes the container before it can flush data to disk. Also, show dbs won’t display your notes DB until it has real data written. To fix this, remove --rm from your docker run so the container shuts down cleanly, and always check with use notes; db.notes.find() instead of just show dbs. Also confirm your volume is mounted with docker volume inspect mongodb. This way, your data will persist across restarts.