this.userId

Server this.userId Source Access inside the publish function. The id of the logged-in user, or null if no user is logged in.

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

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.

Introduction

What is Meteor? Meteor is a full-stack JavaScript platform for developing modern web and mobile applications. Meteor includes a key set of technologies for building connected-client reactive applications, a build tool, and a curated set of packages from the Node.js and general JavaScript community. Meteor allows you to develop in one language, JavaScript, in all environments: application server, web browser, and mobile device. Meteor uses data on the wire, meaning the server sends data, not

Methods

After reading this article, you’ll know: What Methods are in Meteor and how they work in detail. Best practices for defining and calling Methods. How to throw and handle errors with Methods. How to call a Method from a form. What is a Method? Methods are Meteor’s remote procedure call (RPC) system, used to save user input events and data that come from the client. If you’re familiar with REST APIs or HTTP, you can think of them like POST requests to your server, but with many nice features op

Session.set

Client Session.set(key, value) import { Session } from 'meteor/session' Source Set a variable in the session. Notify any listeners that the value has changed (eg: redraw templates, and rerun any Tracker.autorun computations, that called Session.get on this key.) Arguments key String The key to set, eg, selectedItem value EJSON-able Object or undefined The new value for key

dependency.depend

Client dependency.depend([fromComputation]) Source Declares that the current computation (or fromComputation if given) depends on dependency. The computation will be invalidated the next time dependency changes. If there is no current computation and depend() is called with no arguments, it does nothing and returns false. Returns true if the computation is a new dependent of dependency rather than an existing one. Arguments fromComputation Tracker.Computation An optional computation

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.

Cordova.depends

package.js Cordova.depends(dependencies) Specify which Cordova / PhoneGap plugins your Meteor package depends on. Plugins are installed from plugins.cordova.io, so the plugins and versions specified must exist there. Alternatively, the version can be replaced with a GitHub tarball URL as described in the Cordova page of the Meteor wiki on GitHub. Arguments dependencies Object An object where the keys are plugin names and the values are version numbers or GitHub tarball URLs in string

Meteor.settings

Anywhere Meteor.settings import { Meteor } from 'meteor/meteor' Source Meteor.settings contains deployment-specific configuration options. You can initialize settings by passing the --settings option (which takes the name of a file containing JSON data) to meteor run or meteor deploy. When running your server directly (e.g. from a bundle), you instead specify settings by putting the JSON directly into the METEOR_SETTINGS environment variable. If the settings object contains a key named p