chore: upgrade mongodb driver to 6.x (#2716)
* chore: upgrade mongodb driver to 6.x
Bump the Node.js MongoDB driver from ^5.8.0 (5.9.2 installed) to ^6.21.0.
Driver 6.x changed the default of `includeResultMetadata` to `false`, so
`findOneAndUpdate` now returns the document itself instead of a
`ModifyResult`. Every call site that read `result.value` is updated to use
the returned document directly; otherwise lease/claim logic (queued inputs,
Slack leases, ML registry pollers, parked calls) would silently stop
matching rows.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* fix: write a Buffer to the GridFS upload stream
Driver 6.x GridFSBucketWriteStream no longer accepts an ArrayBuffer chunk
(ERR_INVALID_ARG_TYPE). Reuse the already-read ArrayBuffer and wrap it in
Buffer.from instead of casting it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>