Package Exports
- loopback-component-storage-mongo
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (loopback-component-storage-mongo) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
loopback-component-storage-mongo
LoopBack storage mongo component provides Node.js and REST APIs to manage binary contents using Mongodb gridfs
Installation
Install the storage component as usual for a Node package:
npm install --save loopback-component-storage-mongoUsing it
Edit you datasources.json and add the following part
"gridfs": {
"name": "gridfs",
"connector": "loopback-component-storage-mongo",
"host": "localhost",
"port": 27017,
"database": "test"
}And the you can use it as a datasource of your model.
API
| Description | Container model method | REST URI |
|---|---|---|
| List all containers | getContainers(callback) | GET /api/ |
| Get information about specified container | getContainer(container, callback) | GET /api/ |
| Create a new container | createContainer(options, callback) | PORT /api/ |
| Delete specified container | destroyContainer(options, callback) | DELETE /api/ |
| List all files within specified container | getFiles(container, callback) | GET /api/ |
| Get information for specified file within specified container | getFile(container, file, callback) | GET /api/ |
| Delete a file within a given container by name | removeFile(container, file, callback) | DELETE /api/ |
| Upload one or more files into the specified container | upload(container, req, res, callback) | POST /api/ |
| Download a file within specified container | download(container, file, res, callback) | GET /api/ |