Blaze.toHTMLWithData

Client Blaze.toHTMLWithData(templateOrView, data) import { Blaze } from 'meteor/blaze' Source Renders a template or View to HTML with a data context. Otherwise identical to Blaze.toHTML. Arguments templateOrView Blaze.Template or Blaze.View The template (e.g. Template.myTemplate) or View object from which to generate HTML. data Object or Function The data context to use, or a function returning a data context.

Blaze.getData

Client Blaze.getData([elementOrView]) import { Blaze } from 'meteor/blaze' Source Returns the current data context, or the data context that was used when rendering a particular DOM element or View from a Meteor template. Arguments elementOrView DOM Element or Blaze.View Optional. An element that was rendered by a Meteor, or a View.

Blaze.Each

Client Blaze.Each(argFunc, contentFunc, [elseFunc]) import { Blaze } from 'meteor/blaze' Source Constructs a View that renders contentFunc for each item in a sequence. Arguments argFunc Function A function to reactively re-run. The function can return one of two options: An object with two fields: '_variable' and '_sequence'. Each iterates over '_sequence', it may be a Cursor, an array, null, or undefined. Inside the Each body you will be able to get the current item from the sequen

Match.test

Anywhere Match.test(value, pattern) import { Match } from 'meteor/check' Source Returns true if the value matches the pattern. 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

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

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

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

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

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