https://github.com/lwhiteley/mongoose-blob-store
store blobs using mongoose-gridfs
https://github.com/lwhiteley/mongoose-blob-store
abstract-blob-store blob-store feathersjs gridfs mongoose mongoose-gridfs
Last synced: 2 months ago
JSON representation
store blobs using mongoose-gridfs
- Host: GitHub
- URL: https://github.com/lwhiteley/mongoose-blob-store
- Owner: lwhiteley
- License: apache-2.0
- Created: 2018-02-15T13:35:38.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-31T00:08:39.000Z (over 2 years ago)
- Last Synced: 2025-02-24T05:50:20.961Z (3 months ago)
- Topics: abstract-blob-store, blob-store, feathersjs, gridfs, mongoose, mongoose-gridfs
- Language: JavaScript
- Homepage:
- Size: 230 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mongoose-blob-store
store blobs using mongoose gridfs
[](https://badge.fury.io/js/mongoose-blob-store)
[](https://travis-ci.org/lwhiteley/mongoose-blob-store)[](https://github.com/maxogden/abstract-blob-store)
compatible with the [abstract-blob-store](https://github.com/maxogden/abstract-blob-store) API and passes its test suite
eg. Usage
> Please note that the configuration has a breaking change since v0.\*
```js
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