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

onCreated

Client Template.myTemplate.onCreated import { Template } from 'meteor/templating' Source Register a function to be called when an instance of this template is created. Arguments callback Function A function to be added as a callback.

helpers

Client Template.myTemplate.helpers(helpers) import { Template } from 'meteor/templating' Source Specify template helpers available to this template. Arguments helpers Object Dictionary of helper functions by name.

Meteor.Error

Anywhere new Meteor.Error(error, [reason], [details]) import { Meteor } from 'meteor/meteor' Source This class represents a symbolic error thrown by a method. Arguments error String A string code uniquely identifying this kind of error. This string should be used by callers of the method to determine the appropriate action to take, instead of attempting to parse the reason or details fields. For example: // on the server, pick a code unique to this error // the reason field should be

meteor publish

meteor publish Publishes your package. To publish, you must cd into the package directory, log in with your Meteor Developer Account and run meteor publish. By convention, published package names must begin with the maintainer's Meteor Developer Account username and a colon, like so: iron:router. To publish a package for the first time, use meteor publish --create. Sometimes packages may contain binary code specific to an architecture (for example, they may use an npm package). In that case, ru

HTTP.del

Anywhere HTTP.del(url, [callOptions], [asyncCallback]) import { HTTP } from 'meteor/http' Source Send an HTTP DELETE request. Equivalent to calling HTTP.call with "DELETE" as the first argument. (Named del to avoid conflict with the Javascript keyword delete) Arguments url String The URL to which the request should be sent. callOptions Object Options passed on to HTTP.call. asyncCallback Function Callback that is called when the request is completed. Required on the client.

template.findAll

Client template.findAll(selector) Source Find all elements matching selector in this template instance. Arguments selector String The CSS selector to match, scoped to the template contents.

api.addFiles

package.js api.addFiles(filenames, [architecture], [options]) Specify source code files for your package. Arguments filenames String or Array of Strings Paths to the source files. architecture String or Array of Strings If you only want to use the file on the server (or the client), you can pass this argument (e.g., 'server', 'client', 'web.browser', 'web.cordova') to specify what architecture the file is used with. You can specify multiple architectures by passing in an array, fo

Meteor.absoluteUrl

Anywhere Meteor.absoluteUrl([path], [options]) import { Meteor } from 'meteor/meteor' Source Generate an absolute URL pointing to the application. The server reads from the ROOT_URL environment variable to determine where it is running. This is taken care of automatically for apps deployed to Galaxy, but must be provided when using meteor build. Arguments path String A path to append to the root URL. Do not include a leading "/". Options secure Boolean Create an HTTPS URL. re

collection.update

Anywhere collection.update(selector, modifier, [options], [callback]) Source Modify one or more documents in the collection. Returns the number of affected documents. Arguments selector Mongo Selector, Object ID, or String Specifies which documents to modify modifier Mongo Modifier Specifies how to modify the documents callback Function Optional. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second.