|
Meteor-Unity
3
A C#-based SDK for connecting Unity to Meteor servers
|
A Mongo collection corresponding to your More...
Public Member Functions | |
| Collection (string name) | |
| Creates a new Mongo-style collection. Throws an exception if a collection with the given name already exists. If you want a way to get an existing collection instance if it already exists, use Collection<TRecordType>.Create(name) More... | |
| Cursor< TRecordType > | Find (Func< TRecordType, bool > selector=null) |
| Finds documents that match the specified selector. More... | |
| Cursor< TRecordType > | Find (string id) |
| Returns a cursor matching the single ID. Useful for a subsequent observe. More... | |
| Cursor< TRecordType > | Find (IEnumerable< string > ids) |
| Returns a cursor matching an array of document IDs. More... | |
| TRecordType | FindOne (string id) |
| Finds and returns a single document matching the ID. More... | |
| TRecordType | FindOne (Func< TRecordType, bool > selector=null) |
| Finds documents matching the selector and returns the first one matching the selector, in arbitrary order. Throws an exception if none is found. More... | |
| void | Insert (TRecordType record) |
| Inserts a record. Currently not supported. This is a client only representation of the collection. In order to insert documents, define a method on the server that performs the insert, and call that method. The features of the More... | |
| void | Update (string id, IDictionary mongoUpdateCommand, IDictionary mongoUpdateOptions) |
| Updates a record. Currently not supported. This is a client only representation of the collection. In order to update documents, define a method on the server that performs the update, and call that method. The features of the More... | |
Static Public Member Functions | |
| static Collection< TRecordType > | Create (string name) |
| Creates a collection for the specified name. You can call this multiple times and it will return the same instance of a collection if it was already declared somewhere else. More... | |
Public Attributes | |
| string | name |
| The collection name corresponding to your Meteor code's new Mongo.Collection(name) statement More... | |
Protected Member Functions | |
| override string | GetKeyForItem (TRecordType item) |
Static Protected Member Functions | |
| static Collection< TRecordType > | Create (string name, Collection< TRecordType > instance) |
| static Collection< TRecordType > | Convert (string name, Collection< TRecordType > instance) |
Events | |
| Action< string, TRecordType > | WillAddRecord |
| Raised before a documented is added. The first parameter is the document's id, and the second is the record data. More... | |
| Action< string, TRecordType > | DidAddRecord |
| 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[]> | WillChangeRecord |
| Raised before a document is changed. The first parameter is the record id, the second is the record before changes, the third is a dictionary of changes and the last is the list of cleared fields, if any. More... | |
| Action< string, TRecordType, IDictionary, string[]> | DidChangeRecord |
| 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 > | WillRemoveRecord |
| Raised before a document is removed. The first parameter is the record's id. More... | |
| Action< string > | DidRemoveRecord |
| Raised after a document is removed. The first parameter is the record's id. More... | |
A Mongo collection corresponding to your
new Mongo.Collection statements in Meteor. Calling this function is analogous to declaring a model in a traditional ORM (Object-Relation Mapper)-centric framework. It sets up a collection (a storage space for records, or "documents") that can be used to store a particular type of information, like users, posts, scores, todo items, or whatever matters to your application. Each document is a EJSON object. It includes an _id property whose value is unique in the collection, which Meteor will set when you first create the document.
| TRecordType | : | MongoDocument | |
| TRecordType | : | new() |
|
inline |
Creates a new Mongo-style collection. Throws an exception if a collection with the given name already exists. If you want a way to get an existing collection instance if it already exists, use Collection<TRecordType>.Create(name)
| name | Name corresponding to your Meteor code's new Mongo.Collection(name) statement. If null, returns a local-only collection. |
|
inlinestatic |
Creates a collection for the specified name. You can call this multiple times and it will return the same instance of a collection if it was already declared somewhere else.
| name | The name of the collection corresponding to your Meteor code's new Mongo.Collection(name) statement. |
|
inline |
Finds documents that match the specified selector.
| selector | Selector. For example, record => record.type == 1 returns all documents whose "type" field matches "1". This is a standard function that should return true when the document matches. |
|
inline |
Returns a cursor matching the single ID. Useful for a subsequent observe.
| id | Document ID. |
|
inline |
Returns a cursor matching an array of document IDs.
| ids | Document IDs. |
|
inline |
Finds and returns a single document matching the ID.
| System.Collections.Generic.KeyNotFoundException | Throws if the specified document does not exist. |
| id | The document ID. |
|
inline |
Finds documents matching the selector and returns the first one matching the selector, in arbitrary order. Throws an exception if none is found.
| System.Collections.Generic.KeyNotFoundException | Throws if the specified document does not exist. |
| selector | Selector. |
|
inline |
Inserts a record. Currently not supported. This is a client only representation of the collection. In order to insert documents, define a method on the server that performs the insert, and call that method. The features of the
insecure package, like client-side inserts, are not supported.
| record | Record. |
|
inline |
Updates a record. Currently not supported. This is a client only representation of the collection. In order to update documents, define a method on the server that performs the update, and call that method. The features of the
insecure package, like client-side updates, are not supported.
| id | Identifier. |
| mongoUpdateCommand | Mongo update command. |
| mongoUpdateOptions | Mongo update options. |
| string Meteor.Collection< TRecordType >.name |
The collection name corresponding to your Meteor code's new Mongo.Collection(name) statement
| Action<string,TRecordType> Meteor.Collection< TRecordType >.DidAddRecord |
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.Collection< TRecordType >.DidChangeRecord |
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.
| Action<string> Meteor.Collection< TRecordType >.DidRemoveRecord |
Raised after a document is removed. The first parameter is the record's id.
| Action<string,TRecordType> Meteor.Collection< TRecordType >.WillAddRecord |
Raised before 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.Collection< TRecordType >.WillChangeRecord |
Raised before a document is changed. The first parameter is the record id, the second is the record before changes, the third is a dictionary of changes and the last is the list of cleared fields, if any.
| Action<string> Meteor.Collection< TRecordType >.WillRemoveRecord |
Raised before a document is removed. The first parameter is the record's id.
1.8.11