Fork me on GitHub
This API is deprecated since version 0.7.0 and will be removed in a future release (Moved to meteor-rxjs package)

ObservableCursor ⇐ Observable

A class represents a Monog.Cursor wrapped with RxJS features.

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.stop()

Stops the observation on the cursor.

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.<T>

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.<T> - Wrapped Cursor.

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