Accounts.sendEnrollmentEmail

Server Accounts.sendEnrollmentEmail(userId, [email]) import { Accounts } from 'meteor/accounts-base' Source Send an email with a link the user can use to set their initial password. Arguments userId String The id of the user to send email to. email String Optional. Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first email in the list.

Change log

2016/04/16: Switch order of Code Style and Application structure sections. PR #383 2016/04/16: Added Writing Packages - Creating an npm package and Using Packages - Overriding packages - npm. PR #381 2016/04/07: Add more examples and details on application structure using imports. PR #356 2016/04/04: Add more content on writing and publishing Atmosphere packages. PR #339 2016/04/03: Add back in build tool default loading order rules. PR #340 2016/04/01: Added CoffeeScript exports syntax. P

collection.insert

Anywhere collection.insert(doc, [callback]) Source Insert a document in the collection. Returns its unique _id. Arguments doc Object The document to insert. May not yet have an _id attribute, in which case Meteor will generate one for you. callback Function Optional. If present, called with an error object as the first argument and, if no error, the _id as the second.

EJSON.addType

Anywhere EJSON.addType(name, factory) import { EJSON } from 'meteor/ejson' Source Add a custom datatype to EJSON. Arguments name String A tag for your custom type; must be unique among custom data types defined in your project, and must match the result of your type's typeName method. factory Function A function that deserializes a JSON-compatible value into an instance of your type. This should match the serialization performed by your type's toJSONValue method.

Blaze.currentView

Client Blaze.currentView import { Blaze } from 'meteor/blaze' Source The View corresponding to the current template helper, event handler, callback, or autorun. If there isn't one, null.

Blaze.render

Client Blaze.render(templateOrView, parentNode, [nextNode], [parentView]) import { Blaze } from 'meteor/blaze' Source Renders a template or View to DOM nodes and inserts it into the DOM, returning a rendered View which can be passed to Blaze.remove. Arguments templateOrView Blaze.Template or Blaze.View The template (e.g. Template.myTemplate) or View object to render. If a template, a View object is constructed. If a View, it must be an unrendered View, which becomes a rendered View a

Meteor.userId

Anywhere but publish functions Meteor.userId() import { Meteor } from 'meteor/meteor' Source Get the current user id, or null if no user is logged in. A reactive data source.

Accounts.sendResetPasswordEmail

Server Accounts.sendResetPasswordEmail(userId, [email]) import { Accounts } from 'meteor/accounts-base' Source Send an email with a link the user can use to reset their password. Arguments userId String The id of the user to send email to. email String Optional. Which address of the user's to send the email to. This address must be in the user's emails list. Defaults to the first email in the list.

Selectors

Mongo-Style Selectors The simplest selectors are just a string or Mongo.ObjectID. These selectors match the document with that value in its _id field. A slightly more complex form of selector is an object containing a set of keys that must match in a document: // Matches all documents where deleted is false {deleted: false} // Matches all documents where the name and cognomen are as given {name: "Rhialto", cognomen: "the Marvelous"} // Matches every document {} But they can also contain mo

underscore

underscore Underscore is a utility-belt library for JavaScript that provides support for functional programming. It is invaluable for writing clear, concise JavaScript in a functional style. The underscore package defines the _ namespace on both the client and the server. Currently, underscore is included in all projects, as the Meteor core depends on it. _ is available in the global namespace on both the client and the server even if you do not include this package. However if you do use un