@mstan — sorry that you haven't received a response.
NodeBB doesn't save the Mongo database anywhere specific on the file system, it would be wherever the insulted MongoDB install saves it's data.
I've searched and didn't find anything, sorry if duplicated.
I’m running Nodebb on Ubuntu Server 16.02 with MongoDB 3.2. I want to upgrade MongoDB to 4.2 (using apt-get) but I’m wondering if it’s supported by NodeBB?
Yes. As always make a backup of your database with
mongodump before upgrading.