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 Instanceget()- {object[]} - Returns all matching document(s) as an Array. Alias of.fetch()getAsync()- {Promise<object[]>} - Resolves to matching document(s) as an Array. Alias of.fetchAsync()hasNext()- {boolean} - Returnstrueif there is next item available on CursorhasNextAsync()- {Promise} - Resolves totrueif there is next item available on Cursornext()- {object|undefined} - Returns next available object on CursornextAsync()- {Promise<object|undefined>} - Resolves to next available object on CursorhasPrevious()- {boolean} - Returnstrueif there is previous item available on CursorhasPreviousAsync()- {Promise} - Resolves totrueif there is previous item available on Cursorprevious()- {object|undefined} - Returns previous object on CursorpreviousAsync()- {Promise<object|undefined>} - Resolves to previous object on Cursorfetch()- {object[]} - Returns all matching document(s) as an ArrayfetchAsync()- {Promise<object[]>} - Resolves to array with all matching document(s)first()- {object|undefined} - Returns first item on Cursor, if availablefirstAsync()- {Promise<object|undefined>} - Resolves to first item on Cursor, if availablelast()- {object|undefined} - Returns last item on Cursor, if availablelastAsync()- {Promise<object|undefined>} - Resolves to the last item on Cursor, if availablecurrent()- {object|undefined} - Returns current item on Cursor, if availablecurrentAsync()- {Promise<object|undefined>} - Resolves to current item on Cursor, if availablecount()- {number} - Returns the number of documents that match a querycountAsync()- {Promise} - Resolves to the number of documents that match a querycountDocuments(opts: Mongo.CountDocumentsOptions)- {Promise} - Resolves to the number of documents that match a queryremove(callback)- {undefined} - Removes all documents that match a query. Callback haserrorargumentremoveAsync()- {Promise} - Removes all documents that match a query. Resolves into number of removed recordsforEach(callback, context)- {undefined} - Same asforEachAsyncin arguments and contextforEachAsync(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 itselfcontext- {object} - An object which will be the value ofthisinsidecallback
each()- {FileCursor[]} - Same aseachAsyncin arguments and contexteachAsync()- {Promise<FileCursor[]>} - Returns an Array ofFileCursormade for each document on current Cursor. Useful when using in{{#each cursor.each}}...{{/each}}block template helpermap(callback, context)- {object[]} - Same asmapAsyncin arguments and contextmapAsync(callback, context)- {Promise<object[]>} - Mapcallbackover 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 ofthisinsidecallback
observe(callbacks: Mongo.ObserveCallbacks)- {Meteor.LiveQueryHandle} - Same asobserveAsyncin arguments and contextobserveAsync(callbacks: Mongo.ObserveCallbacks)- {Promise<Meteor.LiveQueryHandle>} - 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: Mongo.ObserveChangesCallbacks)- {Meteor.LiveQueryHandle} - Same asobserveChangesAsyncin arguments and contextobserveChangesAsync(callbacks: Mongo.ObserveChangesCallbacks)- {Promise<Meteor.LiveQueryHandle>} - 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