Cursors provide fetch to return all matching documents, map andįorEach to iterate over all matching documents, and observe and It does not immediately access the database or returnĭocuments. Possible values are primary, primaryPreferred, secondary, secondaryPreferred and nearest.įind returns a cursor. (Server only) Specifies a custom MongoDB readPreference for this particular cursor. Setting this is only recommended for advanced users. Return an array of my messages.Ĭonst myMessages = Messages.find( for a reverse collection scan. Works on both the client and the server (see below). The way these methods work isĬompatible with the popular Mongo database API. Remove them, and to find the documents in theĬollection that match arbitrary criteria. The function returns an object with methods to insertĭocuments in the collection, update their properties, and Common code on client and server declares a DDP-managed Mongo collection.Ĭonst Chatrooms = new Mongo.Collection('chatrooms') Ĭonst Messages = new Mongo.Collection('messages') Property whose value is unique in the collection, which Meteor will set when youįirst create the document. Of information, like users, posts, scores, todo items, or whatever matters to Space for records, or “documents”) that can be used to store a particular type (Object-Relation Mapper)-centric framework. Default true.Ĭalling this function is analogous to declaring a model in a traditional ORM Set to false to skip setting up the mutation methods that enable insert/update/remove from client code. Transforms are not applied for the callbacks of observeChanges or to cursors returned from publish functions. Documents will be passed through this function before being returned from fetch or findOne, and before being passed to callbacks of observe, map, forEach, allow, and deny. transform FunctionĪn optional transformation function. The default id generation technique is 'STRING'. The method of generating the _id fields of new documents in this collection. Unmanaged ( name is null) collections cannot specify a connection. Pass the return value of calling DDP.connect to specify a different server. Uses the default connection if not specified. The server connection that will manage this collection. If null, creates an unmanaged (unsynchronized) local collection. Constructor for a Collection Arguments name String
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |