MeteorCollection
Undocumented
-
Undocumented
-
Returns the number of documents in the collection
Declaration
Swift
public var count:Int -
Initializes a MeteorCollection object
Declaration
Swift
public override init(name: String)Parameters
nameThe string name of the collection (must match the name of the collection on the server)
-
Find a single document by id
Declaration
Swift
public func findOne(id: String) -> T?Parameters
idthe id of the document
-
Invoked when a document has been sent from the server.
Declaration
Swift
public override func documentWasAdded(collection:String, id:String, fields:NSDictionary?)Parameters
collectionthe string name of the collection to which the document belongs
idthe string unique id that identifies the document on the server
fieldsan optional NSDictionary with the documents properties
-
Invoked when a document has been changed on the server.
Declaration
Swift
public override func documentWasChanged(collection:String, id:String, fields:NSDictionary?, cleared:[String]?)Parameters
collectionthe string name of the collection to which the document belongs
idthe string unique id that identifies the document on the server
fieldsan optional NSDictionary with the documents properties
clearedOptional array of strings (field names to delete)
-
Invoked when a document has been removed on the server.
Declaration
Swift
public override func documentWasRemoved(collection:String, id:String)Parameters
collectionthe string name of the collection to which the document belongs
idthe string unique id that identifies the document on the server
-
Client-side method to insert a document
Declaration
Swift
public func insert(document: T)Parameters
documenta document that inherits from MeteorDocument
-
Client-side method to update a document
Declaration
Swift
public func update(document: T, withMongoOperation operation: [String:AnyObject])Parameters
documenta document that inherits from MeteorDocument
operationa dictionary containing a Mongo selector and a json object
-
Client-side method to update a document
Declaration
Swift
public func update(document: T)Parameters
documenta document that inherits from MeteorDocument
-
Client-side method to remove a document
Declaration
Swift
public func remove(document: T)Parameters
documenta document that inherits from MeteorDocument
MeteorCollection Class Reference