Gridfs bucket download file native driver

Gridfs bucket download file native driver

gridfs bucket download file native driver

Uses the native GridFSBucket-Api from the new MongoDB NodeJS Driver and wrap it as A skipper adapter to allow uploading files to MongoDB's GridFS. A primer for GridFS using the Mongo DB driver This is the 14th in a series of posts leading up to Node.js Knockout on using mongodb with node-mongodb-​native Each file entry in GridFS has support for metadata documents which 200,000 packages of code, serves 2.2 billion downloads of packages. GridFS bucket exists in MongoDB as two collections with names chunks and Native MongoDB creates this index by itself, but it seems that. gridfs bucket download file native driver

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
Источник: https://cnpmjs.org/package/mongo-gridfs

Gridfs bucket download file native driver

2 thoughts to “Gridfs bucket download file native driver”

Leave a Reply

Your email address will not be published. Required fields are marked *