I haven’t tried MongoDB, but it should be something like PostgreSQL database.
Installing as podman or quadlet should be independent of Gnome/KDE.