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

meteor deploy

meteor deploy site Deploy the project in your current directory to Galaxy. You can deploy in debug mode by passing --debug. This will leave your source code readable by your favorite in-browser debugger, just like it is in local development mode. To delete an application you've deployed, specify the --delete option along with the site. You can add information specific to a particular deployment of your application by using the --settings option. The argument to --settings is a file containing

meteor test-packages

meteor test-packages Test Meteor packages, either by name, or by directory. Not specifying an argument will run tests for all local packages. The results are displayed in an app that runs at localhost:3000 by default. If you need to, you can pass the --settings and --port arguments.

meteor publish-release

meteor publish-release Publishes a release of Meteor. Takes in a JSON configuration file. Meteor releases are divided into tracks. While only MDG members can publish to the default Meteor track, anyone can create a track of their own and publish to it. Running meteor update without specifying the --release option will not cause the user to switch tracks. To publish to a release track for the first time, use the --create-track flag. The JSON configuration file must contain the name of the releas

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

EJSON.stringify

Anywhere EJSON.stringify(val, [options]) import { EJSON } from 'meteor/ejson' Source Serialize a value to a string. For EJSON values, the serialization fully represents the value. For non-EJSON values, serializes the same way as JSON.stringify. Arguments val EJSON-able Object A value to stringify. Options indent Boolean, Integer, or String Indents objects and arrays for easy readability. When true, indents by 2 spaces; when an integer, indents by that number of spaces; and when

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