ObservableCursor ⇐ Observable

Kind: global class
Extends: Observable

new ObservableCursor(cursor)

Param Type Description
cursor Mongo.Cursor.<T> The Mongo.Cursor to wrap.

observableCursor.cursor ⇒ Mongo.Cursor.<T>

Returns the actual Mongo.Cursor that wrapped by current ObservableCursor instance.

Kind: instance property of ObservableCursor
Returns: Mongo.Cursor.<T> - The actual MongoDB Cursor.

observableCursor.collectionCount() ⇒ Observable

A wrapper for Mongo.Cursor.count() method - returns an Observable of number, which triggers each time there is a change in the collection, and exposes the number of objects in the collection.

Kind: instance method of ObservableCursor
Returns: Observable - Observable which trigger the callback when the count of the object changes.

observableCursor.stop()

Stops the observation on the cursor.

Kind: instance method of ObservableCursor

observableCursor.dispose()

Clears the Observable definition. Use this method only when the Observable is still cold, and there are no active subscriptions yet.

Kind: instance method of ObservableCursor

observableCursor.fetch() ⇒ Array.<T>

Return all matching documents as an Array.

Kind: instance method of ObservableCursor
Returns: Array.<T> - The array with the matching documents.

observableCursor.observe(callbacks) ⇒ Meteor.LiveQueryHandle

Watch a query. Receive callbacks as the result set changes.

Kind: instance method of ObservableCursor
Returns: Meteor.LiveQueryHandle - The array with the matching documents.

Param Type Description
callbacks Mongo.ObserveCallbacks The callbacks object.

observableCursor.observeChanges(callbacks) ⇒ 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.

Kind: instance method of ObservableCursor
Returns: Meteor.LiveQueryHandle - The array with the matching documents.

Param Type Description
callbacks Mongo.ObserveChangesCallbacks The callbacks object.

ObservableCursor.create(cursor) ⇒ ObservableCursor

Static method which creates an ObservableCursor from Mongo.Cursor. Use this to create an ObservableCursor object from an existing Mongo.Cursor. Prefer to create an Cursors from the ObservableCollection instance instead.

Kind: static method of ObservableCursor
Returns: ObservableCursor - Wrapped Cursor.

Param Type Description
cursor Mongo.Cursor.<T> The Mongo.Cursor to wrap.