-
-
Notifications
You must be signed in to change notification settings - Fork 169
FilesCursor
dr.dimitru edited this page Jul 22, 2018
·
3 revisions
Implementation of Cursor for FilesCollection. Returned from FilesCollection#find().
import { FilesCollection } from 'meteor/ostrio:files';
const Images = new FilesCollection();
const cursor = Images.find(); // <-- Returns FilesCursor Instance-
get()- {[Object]} - Returns all matching document(s) as an Array. Alias of.fetch() -
hasNext()- {Boolean} - Returnstrueif there is next item available on Cursor -
next()- {Object|undefined} - Returns next available object on Cursor -
hasPrevious()- {Boolean} - Returnstrueif there is previous item available on Cursor -
previous()- {Object|undefined} - Returns previous object on Cursor -
fetch()- {[Object]} - Returns all matching document(s) as an Array -
first()- {Object|undefined} - Returns first item on Cursor, if available -
last()- {Object|undefined} - Returns last item on Cursor, if available -
count()- {Number} - Returns the number of documents that match a query -
remove(callback)- {undefined} - Removes all documents that match a query. Callback haserrorargument -
forEach(callback, context)- {undefined} - Callcallbackonce for each matching document, sequentially and synchronously.-
callback- {Function} - Function to call. It will be called with three arguments: thefile, a 0-based index, and cursor itself -
context- {Object} - An object which will be the value ofthisinsidecallback
-
-
each()- {[FileCursor]} - Returns an Array ofFileCursormade for each document on current Cursor. Useful when using in{{#each FilesCursor#each}}...{{/each}}block template helper -
map(callback, context)- {Array} - Mapcallbackover all matching documents. Returns an Array-
callback- {Function} - Function to call. It will be called with three arguments: thefile, a 0-based index, and cursor itself -
context- {Object} - An object which will be the value ofthisinsidecallback
-
-
current()- {Object|undefined} - Returns current item on Cursor, if available -
observe(callbacks)- {Object} - Functions to call to deliver the result set as it changes. Watch a query. Receive callbacks as the result set changes. Read more here -
observeChanges(callbacks)- {Object} - Watch a query. Receive callbacks as the result set changes. Only the differences between the old and new documents are passed to the callbacks.. Read more here
| Meteor-Files | Support | Try ostr.io |
|---|---|---|
![]() |
If you found this package useful, — star it at GitHub and support our open source contributions with a monthly pledge, or submit a one-time donation via PayPal |
|
