CodeSOD: The Update Route
· remy porter
AI Briefing
- Collection.updateOne is an API method for MongoDB that takes three parameters: a filter to find the document, an update to perform on the document, and an object containing other parameters to control how that update is done. The code was released into production with a route handling callback mixed in with database operations, causing a find-and-replace failure. The code was present in the codebase since 2019 and was removed in a handful of other places, but still managed to cause issues.
Advertisement