
Gridfs bucket download file native driver - not
mongo-gridfs
This is a simple wrapper for the new MongoDB GridFSBucket API.
The old GridStore-API is now deprecated.
How to install
That is simple
OR
Usage
With MongoClient
With Mongoose
Methods
findById
By this method you will simple get the meta-object from the MongoDB as a Promise-Object. If nothing found at the Database, then it will reject and the catch-block will be executed.
downloadFile
You will get the file simple written to the filesystem directly from the Database. If nothing found at the Database, then it will reject and the catch-block will be executed.
readFileStream
You will get a GridFSBucketReadStream as Promise. If nothing found at the Database, then it will reject and the catch-block will be executed.
This method is very useful, to stream the content directly to the user.
For example with express:
Current Tags
- 1.1.0 ... latest (2 years ago)
4 Versions
- 1.1.0 ... 2 years ago
- 1.0.0 ... 2 years ago
- 0.1.0 ... 2 years ago
- 0.0.0 ... 2 years ago
-
-