项目作者: jalik

项目描述 :
GridFS store for UploadFS
高级语言: JavaScript
项目地址: git://github.com/jalik/meteor-jalik-ufs-gridfs.git
创建时间: 2015-07-29T19:31:29Z
项目社区:https://github.com/jalik/meteor-jalik-ufs-gridfs

开源协议:MIT License

下载


UploadFS GridFS Store

A Mongo GridFS store for UploadFS.

Installation

To install the package, execute this command in the root of your project :

  1. meteor add jalik:ufs-gridfs

If later you want to remove the package :

  1. meteor remove jalik:ufs-gridfs

Creating a Store

The code below is available on the client and the server.

GridFS store files in a Mongo database by cutting them in chunks.

  1. import {Mongo} from 'meteor/mongo';
  2. import {UploadFS} from 'meteor/jalik:ufs';
  3. import {GridFSStore} from 'meteor/jalik:ufs-gridfs';
  4. // Declare store collection
  5. const Photos = new Mongo.Collection('photos');
  6. // Declare store
  7. const PhotoStore = new GridFSStore({
  8. collection: Photos,
  9. name: 'photos',
  10. chunkSize: 1024 * 255
  11. });

License

This package is released under the MIT License.