Everything so far ran in mongosh 403 . A server process talks to MongoDB 1,815 through the official driver, the mongodb package, and the difference is not syntax: a shell opens one connection, runs one command and exits, while a web server keeps a pool of sockets open for months, serves hundreds of concurrent requests over them, and must survive a primary stepping down in the middle of a write.
The driver is also the floor under everything else — Mongoose 243,355 (Mongoose) wraps it. What follows is the data layer of a small Express 24,430 API: one shared client, a pool sized on purpose, cursors that stream, errors mapped to status codes, typed collections, and a clean shutdown. Express.js covers the routing around it.