- 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 viaupsertStream
or POST/PUT or Resumable. Now you must useinsertStream
, POST/PUT, or Resumable, without firstinsert
ing. To emphasize this, FileCollection'sinsert
method has been replaced byinsertEmpty
. Relatedly,allow
no longer has awrite
option; instead, POST/PUT and Resumable useinsert
permissions. - BREAKING CHANGE: In
readOneStream
and the newinsertStream
,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