A middleware plugin for Monk (a MongoDB driver) that parses options passed to collection methods. It currently supports the 'safe' option and is intended for use with Monk v7 and earlier. The package is part of the Monk middleware ecosystem and has not been actively developed, with the last release (0.2.1) occurring alongside Monk v4. For modern Monk versions (v7+), option parsing is handled internally or via other middleware such as monk-middleware-cast-ids.
npm install monk-middleware-optionsVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage: requiring monk, applying the options middleware to a collection, and using the 'safe' option.
Use writeConcern instead. For Monk v7+, writeConcern is automatically set via connection URI or driver options.
Use monk-middleware-cast-ids or handle other options manually.
Remove usage of this middleware; options are now passed directly to Monk methods.
Upgrade to Monk v6+ and remove calls to .use(). Options are passed directly to methods.
Use writeConcern instead: { writeConcern: { w: 1 } }.