collection.allow

Server collection.allow(options) Source Allow users to write directly to this collection from client code, subject to limitations you define. Options insert, update, remove Function Functions that look at a proposed modification to the database and return true if it should be allowed. fetch Array of Strings Optional performance enhancement. Limits the fields that will be fetched from the database for inspection by your update and remove functions. transform Function Overrides

collection.find

Anywhere collection.find([selector], [options]) Source Find the documents in a collection that match the selector. Arguments selector Mongo Selector, Object ID, or String A query describing the documents to find Options sort Mongo Sort Specifier Sort order (default: natural order) skip Number Number of results to skip at the beginning limit Number Maximum number of results to return fields Mongo Field Specifier Dictionary of fields to return or exclude. reactive B

Sort specifiers

Sort Specifiers Sorts may be specified using your choice of several syntaxes: // All of these do the same thing (sort in ascending order by // key "a", breaking ties in descending order of key "b") [["a", "asc"], ["b", "desc"]] ["a", ["b", "desc"]] {a: 1, b: -1} The last form will only work if your JavaScript implementation preserves the order of keys in objects. Most do, most of the time, but it's up to you to be sure. For local collections you can pass a comparator function which receives

Match patterns

Match Patterns The following patterns can be used as pattern arguments to check and Match.test: Match.Any Matches any value. String, Number, Boolean, undefined, null Matches a primitive of the given type. Match.Integer Matches a signed 32-bit integer. Doesn't match Infinity, -Infinity, or NaN. [pattern] A one-element array matches an array of elements, each of which match pattern. For example, [Number] matches a (possibly empty) array of numbers; [Match.Any] matches any array. {key1: pattern1

check

Anywhere check(value, pattern) import { check } from 'meteor/check' Source Check that a value matches a pattern. If the value does not match the pattern, throw a Match.Error. Particularly useful to assert that arguments to a function have the right types and structure. Arguments value Any The value to check pattern Match Pattern The pattern to match value against

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.loginWith<Service>

Client Meteor.loginWith<ExternalService>([options], [callback]) import { Meteor } from 'meteor/meteor' Source Log the user in using an external service. Arguments callback Function Optional callback. Called with no arguments on success, or with a single Error argument on failure. The callback cannot be called if you are using the "redirect" loginStyle, because the app will have reloaded in the meantime; try using client-side login hooks instead. Options requestPermissions A

Meteor.logoutOtherClients

Client Meteor.logoutOtherClients([callback]) import { Meteor } from 'meteor/meteor' Source Log out other clients logged in as the current user, but does not log out the client that calls this function. Arguments callback Function Optional callback. Called with no arguments on success, or with a single Error argument on failure.

AccountsServer#onCreateUser

Server accountsServer.onCreateUser(func) Source Customize new user creation. Arguments func Function Called whenever a new user is created. Return the new user object, or throw an Error to abort the creation.

AccountsServer#validateLoginAttempt

Server accountsServer.validateLoginAttempt(func) Source Validate login attempts. Arguments func Function Called whenever a login is attempted (either successful or unsuccessful). A login can be aborted by returning a falsy value or throwing an exception.