Skip to content

v2.0.0 Rewrite to GridFSBucket

Latest
Compare
Choose a tag to compare
@edemaine edemaine released this 05 Mar 17:54
· 1 commit to main since this release
  • Major rewrite, with three significant breaking changes:
  • BREAKING CHANGE: No more file locking, under the assumption that you write files once during upload and henceforth do concurrent reads. Make sure your app doesn't require locking.
  • BREAKING CHANGE: Files with contents can be created only by directly uploading contents. Previously, you needed to insert a document and (when that completed) upload the contents via upsertStream or POST/PUT or Resumable. Now you must use insertStream, POST/PUT, or Resumable, without first inserting. To emphasize this, FileCollection's insert method has been replaced by insertEmpty. Relatedly, allow no longer has a write option; instead, POST/PUT and Resumable use insert permissions.
  • BREAKING CHANGE: In readOneStream and the new insertStream, options.range.end is exclusive (before it was inclusive), and cannot be larger than the file size (before it was implicitly min'd). This won't affect you if you're using the built-in GET handler, which converts from HTTP's inclusive Range to exclusive. If you've written your own GET handler, you'll want to offset by 1.
  • Upgrade to MongoDB's v4 drivers, in particular the modern GridFSBucket interface
  • No more gridfs-locking-stream dependency

Full Changelog: 1.3.8...v2.0.0