Implementation of Cursor for FilesCollection. Returned from FilesCollection#find()
.
import { FilesCollection } from 'meteor/ostrio:files';
const imagesCollection = new FilesCollection();
const cursor = imagesCollection.find(); // <-- Returns FilesCursor Instance
get()
- {[Object]} - Returns all matching document(s) as an Array. Alias of.fetch()
hasNext()
- {Boolean} - Returnstrue
if there is next item available on Cursornext()
- {Object|undefined} - Returns next available object on CursorhasPrevious()
- {Boolean} - Returnstrue
if there is previous item available on Cursorprevious()
- {Object|undefined} - Returns previous object on Cursorfetch()
- {[Object]} - Returns all matching document(s) as an Arrayfirst()
- {Object|undefined} - Returns first item on Cursor, if availablelast()
- {Object|undefined} - Returns last item on Cursor, if availablecount()
- {Number} - Returns the number of documents that match a queryremove(callback)
- {undefined} - Removes all documents that match a query. Callback haserror
argumentforEach(callback, context)
- {undefined} - Callcallback
once 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 itselfcontext
- {Object} - An object which will be the value ofthis
insidecallback
each()
- {[FileCursor]} - Returns an Array ofFileCursor
made for each document on current Cursor. Useful when using in{{#each cursor.each}}...{{/each}}
block template helpermap(callback, context)
- {Array} - Mapcallback
over all matching documents. Returns an Arraycallback
- {Function} - Function to call. It will be called with three arguments: thefile
, a 0-based index, and cursor itselfcontext
- {Object} - An object which will be the value ofthis
insidecallback
current()
- {Object|undefined} - Returns current item on Cursor, if availableobserve(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 hereobserveChanges(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