Skip to content

lwhiteley/mongoose-blob-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mongoose-blob-store

store blobs using mongoose gridfs

npm version Build Status

blob-store-compatible

compatible with the abstract-blob-store API and passes its test suite

eg. Usage

Please note that the configuration has a breaking change since v0.*

const store = require('mongoose-blob-store'); // connect mongoose to mongo db then use the connection const mongooseConnection = require('mongoose').connection; const blobStorage = store({ mongooseConnection, collection: 'attachments', modelName: 'Attachment', }); //write blobStorage.createWriteStream(opts, cb); //read const stream = blobStorage.createReadStream(opts); //remove blobStorage.remove(opts, cb); //check if file exists blobStorage.exists(opts, cb);

pull requests are welcome

Packages

No packages published

Contributors 2

  •  
  •