Mongoose is ideal for embedded environments. It has been designed for connecting devices and bringing them online. On the market since 2004, used by vast number of open source and commercial products ...
This could instead be an issue with the React docs rather than with Next, but the CodeSandbox example in the docs (you can access it directly via the "fork" link) indeed appears to be a server ...