An observe handle. Returned by Meteor.Cursor.Find.
More...
|
| Observe (Collection< TRecordType > collection, Action< string, TRecordType > added=null, Action< string, TRecordType, IDictionary, string[]> changed=null, Action< string > removed=null, Func< TRecordType, bool > selector=null, IEnumerable< string > fields=null) |
| Creates a new observe handle without a cursor. It is recommended to use Meteor.Collection`1.Find to get a cursor and then call More...
|
|
void | Stop () |
| Stops observing changes to the collection with the given selector. More...
|
|
void | Dispose () |
| Releases all resource used by the Meteor.Observe`1 object. More...
|
|
|
HashSet< String > | Fields |
|
string | idToRemove |
|
|
Action< string, TRecordType > | Added [get] |
| Raised after a documented is added. The first parameter is the document's id, and the second is the record data. More...
|
|
Action< string, TRecordType, IDictionary, string[]> | Changed [get] |
| Raised after a document is changed. The first parameter is the record id, the second is the new record, the third is a dictionary of changes and the last is the list of cleared fields, if any. More...
|
|
Action< string > | Removed [get] |
| Raised after a document is removed. The first parameter is the record's id. More...
|
|
Func< TRecordType, bool > | RecordSelector [get] |
|
bool | Initializing [get, protected set] |
| Is this observe handle receiving its first matching set of documents to add? More...
|
|
Collection< TRecordType > | Collection [get, protected set] |
| Gets the collection referenced by this observe handle. More...
|
|
An observe handle. Returned by Meteor.Cursor.Find.
Meteor.Observe< TRecordType >.Observe |
( |
Collection< TRecordType > |
collection, |
|
|
Action< string, TRecordType > |
added = null , |
|
|
Action< string, TRecordType, IDictionary, string[]> |
changed = null , |
|
|
Action< string > |
removed = null , |
|
|
Func< TRecordType, bool > |
selector = null , |
|
|
IEnumerable< string > |
fields = null |
|
) |
| |
|
inline |
Creates a new observe handle without a cursor. It is recommended to use Meteor.Collection`1.Find to get a cursor and then call
Observe
on that cursor. An observe invokes callbacks when the result of the query changes. The callbacks receive the entire contents of the document that was affected, as well as its old contents, if applicable. Before observe returns, added will be called zero or more times to deliver the initial results of the query. This method returns an Observe instance, which is an object with a stop method. Call stop with no arguments to stop calling the callback functions and tear down the query. The query will run forever until you call this.
- Parameters
-
added | A new document document entered the result set. |
changed | A callback for changes to documents. The first argument is the ID, the second the entire record, the third a dictionary of fields that were changed as keys and the new values as values, and an array of strings specifying any deleted fields. The second argument, the entire document, has the changes already applied to it. |
removed | A document with the given ID was removed. The callback is called after the document is removed from the collection. |
collection | Collection. |
selector | Selector. |
fields | Fields. Currently not supported. |
Releases all resource used by the Meteor.Observe`1 object.
Call Dispose when you are finished using the Meteor.Observe`1. The Dispose method leaves the Meteor.Observe`1 in an unusable state. After calling Dispose, you must release all references to the Meteor.Observe`1 so the garbage collector can reclaim the memory that the Meteor.Observe`1 was occupying.
Stops observing changes to the collection with the given selector.
Raised after a documented is added. The first parameter is the document's id, and the second is the record data.
Action<string,TRecordType,IDictionary,string[]> Meteor.Observe< TRecordType >.Changed |
|
get |
Raised after a document is changed. The first parameter is the record id, the second is the new record, the third is a dictionary of changes and the last is the list of cleared fields, if any.
Gets the collection referenced by this observe handle.
The collection.
Is this observe handle receiving its first matching set of documents to add?
true
if initializing; otherwise, false
.
Raised after a document is removed. The first parameter is the record's id.
The documentation for this class was generated from the following file: