Four verbs cover almost everything an application asks of MongoDB 1,815 , and the API is identical in mongosh 403 and in the Node.js 2,131 driver — the shell is a Node REPL with the driver loaded (Working in mongosh) — so a query you debug at the prompt pastes into an Express 24,430 route unchanged, apart from the await. Everything in this section ran against MongoDB 8.3.11 on 127.0.0.1.
Two rules shape what follows. A write to a single document is atomic: the server takes a document-level lock and no reader sees half of it, but that guarantee stops at one document unless you open a transaction (Collections and Search). And every write returns a small result document rather than the data it touched — insertedId, matchedCount, modifiedCount, deletedCount — so check those counts instead of assuming success. Ignoring them is the commonest source of "the update silently did nothing". Only findOneAndUpdate and findOneAndDelete hand back the affected document itself.