This repository was archived by the owner on Mar 14, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 234
Introduction
Brylie Christopher Oxley edited this page Mar 2, 2015
·
2 revisions
The CollectionFS package makes available two important global variables:
FS.File and FS.Collection.
- An
FS.Fileinstance wraps a file and its data on the client or server. It is similar to the browserFileobject (and can be created from aFileobject), but it has additional properties and methods. Many of its methods are reactive when the instance is returned by a call tofindorfindOne. - An
FS.Collectionprovides a collection in which information about files can be stored. It is backed by an underlying normalMongo.Collectioninstance. Most collection methods, such asfindandinsertare available on theFS.Collectioninstance. If you need to call other collection methods such as_ensureIndex, you can call them directly on the underlyingMongo.Collectioninstance available throughmyFSCollection.files.
A document from a FS.Collection is represented as a FS.File.
CollectionFS also provides an HTTP upload package that has the necessary mechanisms to upload files, track upload progress reactively, and pause and resume uploads. This can be swapped for a DDP upload package, but we do not currently recommend using DDP for uploads due to known issues with the current DDP spec and large files.
footer25555555