diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000000..aa646abbd3c --- /dev/null +++ b/.mailmap @@ -0,0 +1,35 @@ +# This makes it easier to find GitHub usernames for History.md. +# +# This controls 'git shortlog'. eg, run: +# git shortlog -s release/0.6.5.1..HEAD +# to get a sorted list of all committers to revisions in HEAD but not +# in 0.6.5.1. +# +# For any emails that show up in the shortlog that aren't in one of +# these lists, figure out their GitHub username and add them. + +GITHUB: ansman +GITHUB: awwx +GITHUB: codeinthehole +GITHUB: jacott +GITHUB: Maxhodges +GITHUB: meawoppl +GITHUB: mitar +GITHUB: mizzao +GITHUB: mquandalle +GITHUB: nathan-muir +GITHUB: RobertLowe +GITHUB: ryw +GITHUB: sdarnell +GITHUB: timhaines + +METEOR: avital +METEOR: debergalis +METEOR: dgreensp +METEOR: estark37 +METEOR: estark37 +METEOR: glasser +METEOR: gschmidt +METEOR: n1mmy +METEOR: sixolet +METEOR: Slava diff --git a/History.md b/History.md index 3db302fed6b..eb777bb6242 100644 --- a/History.md +++ b/History.md @@ -1,22 +1,185 @@ ## vNEXT -* Better error when passing a string to {{#each}}. #722 +* Fail explicitly when publishing non-cursors. -* Write dates to Mongo as ISODate rather than Integer; existing data can be - converted by passing it through `new Date()`. #1228 +* Implement `$each`, `$sort`, and `$slice` options for minimongo's `$push` + modifier. -* Login token deletion: Expire login tokens periodically. Add - Meteor._logoutAllOthers() for logging out other connections logged in as the - current user. Log out and close connections for deleted users and tokens. +* Upgraded dependencies: + * SockJS server from 0.3.7 to 0.3.8 + + +## v0.6.6.1 + +* Fix file watching on OSX. Work around Node issue #6251 by not using + fs.watch. #1483 + +## v0.6.6 + + +#### Security + +* Add `browser-policy` package for configuring and sending + Content-Security-Policy and X-Frame-Options HTTP headers. + [See the docs](http://docs.meteor.com/#browserpolicy) for more. + +* Use cryptographically strong pseudorandom number generators when available. + +#### MongoDB + +* Add upsert support. `Collection.update` now supports the `{upsert: + true}` option. Additionally, add a `Collection.upsert` method which + returns the newly inserted object id if applicable. + +* `update` and `remove` now return the number of documents affected. #1046 + +* `$near` operator for `2d` and `2dsphere` indices. + +* The `fields` option to the collection methods `find` and `findOne` now works + on the client as well. (Operators such as `$elemMatch` and `$` are not yet + supported in `fields` projections.) #1287 + +* Pass an index and the cursor itself to the callbacks in `cursor.forEach` and + `cursor.map`, just like the corresponding `Array` methods. #63 + +* Support `c.find(query, {limit: N}).count()` on the client. #654 + +* Improve behavior of `$ne`, `$nin`, and `$not` selectors with objects containing + arrays. #1451 + +* Fix various bugs if you had two documents with the same _id field in + String and ObjectID form. + +#### Accounts + +* [Behavior Change] Expire login tokens periodically. Defaults to 90 + days. Use `Accounts.config({loginExpirationInDays: null})` to disable + token expiration. + +* [Behavior Change] Write dates generated by Meteor Accounts to Mongo as + Date instead of number; existing data can be converted by passing it + through `new Date()`. #1228 + +* Log out and close connections for users if they are deleted from the + database. + +* Add Meteor.logoutOtherClients() for logging out other connections + logged in as the current user. + +* `restrictCreationByEmailDomain` option in `Accounts.config` to restrict new + users to emails of specific domain (eg. only users with @meteor.com emails) or + a custom validator. #1332 + +* Support OAuth1 services that require request token secrets as well as + authentication token secrets. #1253 + +* Warn if `Accounts.config` is only called on the client. #828 + +* Fix bug where callbacks to login functions could be called multiple + times when the client reconnects. + +#### DDP + +* Fix infinite loop if a client disconnects while a long yielding method is + running. + +* Unfinished code to support DDP session resumption has been removed. Meteor + servers now stop processing messages from clients and reclaim memory + associated with them as soon as they are disconnected instead of a few minutes + later. + +#### Tools * The pre-0.6.5 `Package.register_extension` API has been removed. Use `Package._transitional_registerBuildPlugin` instead, which was introduced in 0.6.5. (A bug prevented the 0.6.5 reimplementation of `register_extension` from working properly anyway.) +* Support using an HTTP proxy in the `meteor` command line tool. This + allows the `update`, `deploy`, `logs`, and `mongo` commands to work + behind a proxy. Use the standard `http_proxy` environment variable to + specify your proxy endpoint. #429, #689, #1338 + * Build Linux binaries on an older Linux machine. Meteor now supports running on Linux machines with glibc 2.9 or newer (Ubuntu 10.04+, RHEL - and CentOS 6+, Fedora 10+, Debian 6+). + and CentOS 6+, Fedora 10+, Debian 6+). Improve error message when running + on Linux with unsupported glibc, and include Mongo stderr if it fails + to start. + +* Install NPM modules with `--force` to avoid corrupted local caches. + +* Rebuild NPM modules in packages when upgrading to a version of Meteor that + uses a different version of Node. + +* Disable the Mongo http interface. This lets you run meteor on two ports + differing by 1000 at the same time. + +#### Misc + +* [Known issue] Breaks support for pre-release OSX 10.9 'Mavericks'. + Will be addressed shortly. See issues: + https://github.com/joyent/node/issues/6251 + https://github.com/joyent/node/issues/6296 + +* `EJSON.stringify` now takes options: + - `canonical` causes objects keys to be stringified in sorted order + - `indent` allows formatting control over the EJSON stringification + +* EJSON now supports `Infinity`, `-Infinity` and `NaN`. + +* Check that the argument to `EJSON.parse` is a string. #1401 + +* Better error from functions that use `Meteor._wrapAsync` (eg collection write + methods and `HTTP` methods) and in DDP server message processing. #1387 + +* Support `appcache` on Chrome for iOS. + +* Support literate CoffeeScript files with the extension `.coffee.md` (in + addition to the already-supported `.litcoffee` extension). #1407 + +* Make `madewith` package work again (broken in 0.6.5). #1448 + +* Better error when passing a string to `{{#each}}`. #722 + +* Add support for JSESSIONID cookies for sticky sessions. Set the + `USE_JSESSIONID` environment variable to enable placing a JSESSIONID + cookie on sockjs requests. + +* Simplify the static analysis used to detect package-scope variables. + +* Upgraded dependencies: + * Node from 0.8.24 to 0.10.20 + * MongoDB from 2.4.4 to 2.4.6 + * MongoDB driver from 1.3.17 to 1.3.19 + * http-proxy from 0.10.1 to a pre-release of 1.0.0 + * stylus from 0.30.1 to 0.37.0 + * nib from 0.8.2 to 1.0.0 + * optimist from 0.3.5 to 0.6.0 + * semver from 1.1.0 to 2.1.0 + * request from 2.12.0 to 2.27.0 + * keypress from 0.1.0 to 0.2.1 + * underscore from 1.5.1 to 1.5.2 + * fstream from 0.1.21 to 0.1.24 + * tar from 0.1.14 to 0.1.18 + * source-map from 0.1.26 to 0.1.30 + * source-map-support from a fork of 0.1.8 to 0.2.3 + * escope from a fork of 0.0.15 to 1.0.0 + * estraverse from 1.1.2-1 to 1.3.1 + * simplesmtp from 0.1.25 to 0.3.10 + * stream-buffers from 0.2.3 to 0.2.5 + * websocket from 1.0.7 to 1.0.8 + * cli-color from 0.2.2 to 0.2.3 + * clean-css from 1.0.11 to 1.1.2 + * UglifyJS2 from a fork of 2.3.6 to a different fork of 2.4.0 + * connect from 2.7.10 to 2.9.0 + * send from 0.1.0 to 0.1.4 + * useragent from 2.0.1 to 2.0.7 + * replaced byline with eachline 2.3.3 + +Patches contributed by GitHub users ansman, awwx, codeinthehole, jacott, +Maxhodges, meawoppl, mitar, mizzao, mquandalle, nathan-muir, RobertLowe, ryw, +sdarnell, and timhaines. + ## v0.6.5.1 diff --git a/LICENSE.txt b/LICENSE.txt index 319a50a9637..8facf5235db 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -90,6 +90,7 @@ github-url-from-git: https://github.com/visionmedia/node-github-url-from-git pause: https://github.com/visionmedia/node-pause range-parser: https://github.com/visionmedia/node-range-parser send: https://github.com/visionmedia/send +methods: https://github.com/visionmedia/node-methods ---------- Copyright (c) 2010 TJ Holowaychuk @@ -191,13 +192,6 @@ rbytes: https://github.com/akdubya/rbytes Copyright (c) 2010 Aleksander Williams ----------- -formidable: https://github.com/felixge/node-formidable ----------- - -By Felix Geisendörfer and Tim Koschuetzki, Debuggable, Ltd. - - ---------- colors: https://github.com/Marak/colors.js ---------- @@ -245,9 +239,11 @@ Copyright (c) 2012 Nathan Rajlich ---------- faye-websocket: https://github.com/faye/faye-websocket-node +websocket-driver: https://github.com/faye/websocket-driver-node ---------- -Copyright (c) 2009-2012 James Coglan +Copyright (c) 2009-2013 James Coglan +Copyright (c) 2010-2013 James Coglan ---------- @@ -291,6 +287,7 @@ archy: https://github.com/substack/node-archy shell-quote: https://github.com/substack/node-shell-quote deep-equal: https://github.com/substack/node-deep-equal editor: https://github.com/substack/node-editor +minimist: https://github.com/substack/node-minimist ---------- Copyright 2010, 2011, 2012, 2013 James Halliday (mail@substack.net) @@ -328,6 +325,7 @@ Felix Geisendörfer (felix@debuggable.com) ---------- form-data: https://github.com/felixge/node-form-data +multiparty: https://github.com/superjoe30/node-multiparty ---------- Copyright (c) 2012 Felix Geisendörfer (felix@debuggable.com) and contributors @@ -377,13 +375,6 @@ buffer-crc32: https://github.com/brianloveswords/buffer-crc32 Copyright (c) 2013 Brian J. Brennan ----------- -byline: https://github.com/jahewson/node-byline ----------- - -node-byline (C) 2011-2013 John Hewson - - ---------- child-process-close: https://github.com/piscisaureus/child-process-close ---------- @@ -475,6 +466,8 @@ Copyright (c) 2011 SDA Software Associates Inc. ---------- sha: https://github.com/ForbesLindesay/sha +type-of: https://github.com/ForbesLindesay/type-of +uglify-to-browserify: https://github.com/ForbesLindesay/uglify-to-browserify ---------- Copyright (c) 2013 Forbes Lindesay @@ -516,6 +509,38 @@ Copyright 2011, Robert Mustacchi. All rights reserved. Copyright 2011, Joyent, Inc. All rights reserved. +---------- +eachline: https://github.com/williamwicks/node-eachline +---------- + +Copyright (c) 2013 William Wicks + + +---------- +eventemitter2: https://github.com/hij1nx/EventEmitter2 +---------- + +Copyright (c) 2011 hij1nx http://www.twitter.com/hij1nx + + +---------- +stream-counter: https://github.com/superjoe30/node-stream-counter +---------- + +Copyright (c) 2013 Andrew Kelley + +---------- +uid2: https://github.com/coreh/uid2 +---------- + +Copyright (c) 2013 Marco Aurelio + +---------- +geojson-utils: https://github.com/maxogden/geojson-js-utils +---------- + +Copyright (c) 2010 Max Ogden + ============== Apache License ============== @@ -531,7 +556,8 @@ Unless required by applicable law or agreed to in writing, software distributed """ ---------- -mongo-drivers: https://github.com/mongodb/node-mongodb-native +mongodb: (Node driver) https://github.com/mongodb/node-mongodb-native +kerberos: https://github.com/christkv/kerberos ---------- Copyright 2009 - 2010 Christian Amor Kvalheim. @@ -1309,7 +1335,7 @@ Other ===== ---------- -mimelib: https://github.com/andris9/mimelib +mimelib-noiconv: https://github.com/andris9/mimelib mailcomposer: https://github.com/andris9/mailcomposer simplesmtp: https://github.com/andris9/simplesmtp rai: https://github.com/andris9/rai @@ -1407,7 +1433,7 @@ For more information, please refer to ---------- -mongodb: http://www.mongodb.org/ +MongoDB: http://www.mongodb.org/ ---------- LICENSE @@ -1711,6 +1737,7 @@ The externally maintained libraries used by libuv are: ---------- nodejs: http://nodejs.org/ +readable-stream: https://github.com/isaacs/readable-stream/ ---------- diff --git a/README.md b/README.md index 9545721dba8..f128f12057b 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,8 @@ From your checkout, you can read the docs locally. The `/docs` directory is a meteor application, so simply change into the `/docs` directory and launch the app: - cd docs/ - meteor + cd docs/ + ../meteor You'll then be able to read the docs locally in your browser at `http://localhost:3000/` diff --git a/docs/.meteor/release b/docs/.meteor/release index 3f50c3b8052..62a4661cc6e 100644 --- a/docs/.meteor/release +++ b/docs/.meteor/release @@ -1 +1 @@ -galaxy-appconfig-2 +galaxy-follower-5 diff --git a/docs/client/api.html b/docs/client/api.html index 3aa992a512e..1d6a2be2629 100644 --- a/docs/client/api.html +++ b/docs/client/api.html @@ -62,9 +62,9 @@

Publish and subscribe

Publish functions can return a [`Collection.Cursor`](#meteor_collection_cursor), in which case Meteor -will publish that cursor's documents. You can also return an array of -`Collection.Cursor`s, in which case Meteor will publish all of the -cursors. +will publish that cursor's documents to each subscribed client. You can +also return an array of `Collection.Cursor`s, in which case Meteor will +publish all of the cursors. {{#warning}} If you return multiple cursors in an array, they currently must all be from @@ -92,16 +92,15 @@

Publish and subscribe

]; }); -Otherwise, the publish function should call the functions -[`added`](#publish_added) (when a new document is added to the published record -set), [`changed`](#publish_changed) (when some fields on a document in the -record set are changed or cleared), and [`removed`](#publish_removed) (when -documents are removed from the published record set) to inform subscribers about -documents. These methods are provided by `this` in your publish function. - - - - +Alternatively, a publish function can directly control its published +record set by calling the functions [`added`](#publish_added) (to add a +new document to the published record set), [`changed`](#publish_changed) +(to change or clear some fields on a document already in the published +record set), and [`removed`](#publish_removed) (to remove documents from +the published record set). Publish functions that use these functions +should also call [`ready`](#publish_ready) once the initial record set +is complete. These methods are provided by `this` in your publish +function. Example: @@ -634,7 +633,7 @@

Collections

of selectors. * `$` to denote the matched array position is not supported in modifier. -* `findAndModify`, upsert, aggregate functions, and +* `findAndModify`, aggregate functions, and map/reduce aren't supported. All of these will be addressed in a future release. For full @@ -723,24 +722,27 @@

Collections

`multi` to true, and can use an arbitrary [Mongo selector](#selectors) to find the documents to modify. It bypasses any access control rules set up by [`allow`](#allow) and - [`deny`](#deny). + [`deny`](#deny). The number of affected documents will be returned + from the `update` call if you don't pass a callback. - Untrusted code can only modify a single document at once, specified by its `_id`. The modification is allowed only after checking any - applicable [`allow`](#allow) and [`deny`](#deny) rules. + applicable [`allow`](#allow) and [`deny`](#deny) rules. The number + of affected documents will be returned to the callback. Untrusted + code cannot perform upserts, except in insecure mode. On the server, if you don't provide a callback, then `update` blocks until the database acknowledges the write, or throws an exception if something went wrong. If you do provide a callback, `update` returns immediately. Once the update completes, the callback is called with a -single error argument in the case of failure, or no arguments if the -update was successful. +single error argument in the case of failure, or a second argument +indicating the number of affected documents if the update was successful. On the client, `update` never blocks. If you do not provide a callback and the update fails on the server, then Meteor will log a warning to the console. If you provide a callback, Meteor will call that function -with an error argument if there was an error, or no arguments if the -update was successful. +with an error argument if there was an error, or a second argument +indicating the number of affected documents if the update was successful. Client example: @@ -766,9 +768,18 @@

Collections

} }); -{{#warning}} -The Mongo `upsert` feature is not implemented. -{{/warning}} +You can use `update` to perform a Mongo upsert by setting the `upsert` +option to true. You can also use the [`upsert`](#upsert) method to perform an +upsert that returns the _id of the document that was inserted (if there was one) +in addition to the number of affected documents. + +{{> api_box upsert}} + +Modify documents that match `selector` according to `modifier`, or insert +a document if no documents were modified. `upsert` is the same as calling +`update` with the `upsert` option set to true, except that the return +value of `upsert` is an object that contain the keys `numberAffected` +and `insertedId`. (`update` returns only the number of affected documents.) {{> api_box remove}} @@ -784,7 +795,8 @@

Collections

find the documents to remove, and can remove more than one document at once by passing a selector that matches multiple documents. It bypasses any access control rules set up by [`allow`](#allow) and - [`deny`](#deny). + [`deny`](#deny). The number of removed documents will be returned + from `remove` if you don't pass a callback. As a safety measure, if `selector` is omitted (or is `undefined`), no documents will be removed. Set `selector` to `{}` if you really @@ -792,20 +804,22 @@

Collections

- Untrusted code can only remove a single document at a time, specified by its `_id`. The document is removed only after checking - any applicable [`allow`](#allow) and [`deny`](#deny) rules. + any applicable [`allow`](#allow) and [`deny`](#deny) rules. The + number of removed documents will be returned to the callback. On the server, if you don't provide a callback, then `remove` blocks -until the database acknowledges the write, or throws an exception if +until the database acknowledges the write and then returns the number +of removed documents, or throws an exception if something went wrong. If you do provide a callback, `remove` returns immediately. Once the remove completes, the callback is called with a -single error argument in the case of failure, or no arguments if the -remove was successful. +single error argument in the case of failure, or a second argument +indicating the number of removed documents if the remove was successful. On the client, `remove` never blocks. If you do not provide a callback -and the remove fails on the server, then Meteor will log a warning to -the console. If you provide a callback, Meteor will call that function -with an error argument if there was an error, or no arguments if the -remove was successful. +and the remove fails on the server, then Meteor will log a warning to the +console. If you provide a callback, Meteor will call that function with an +error argument if there was an error, or a second argument indicating the number +of removed documents if the remove was successful. Client example: @@ -966,6 +980,8 @@

Cursors

{{> api_box cursor_foreach}} +This interface is compatible with [Array.forEach](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach). + When called from a reactive computation, `forEach` registers dependencies on the matching documents. @@ -981,6 +997,8 @@

Cursors

{{> api_box cursor_map}} +This interface is compatible with [Array.map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map). + When called from a reactive computation, `map` registers dependencies on the matching documents. @@ -1258,12 +1276,13 @@

Cursors

// Users.find({}, {fields: {password: 0, hash: 0}}) To return an object that only includes the specified field, use `1` as -the value. The `_id` field is still included in the result. +the value. The `_id` field is still included in the result. // Users.find({}, {fields: {firstname: 1, lastname: 1}}) -It is not possible to mix inclusion and exclusion styles (exception for `_id`). -Field operators such as `$` and `$elemMatch` are not available on client side yet. +It is not possible to mix inclusion and exclusion styles (except for the cases +when `_id` is included by default or explicitly excluded). Field operators such +as `$` and `$elemMatch` are not available on the client side yet. More advanced example: @@ -1275,7 +1294,8 @@

Cursors

// returns { alterEgos: [{ name: "Kira" }, { name: "L" }] } -Notice the nested field rule and array behavior, learn more in MongoDB docs. +See +the MongoDB docs for details of the nested field rules and array behavior. {{/api_box_inline}} @@ -1495,6 +1515,12 @@

Accounts

{{> api_box logout}} +{{> api_box logoutOtherClients}} + +For example, when called in a user's browser, connections in that browser +remain logged in, but any other browsers or DDP clients logged in as that user +will be logged out. + {{> api_box loginWithPassword}} This function is provided by the `accounts-password` package. See the diff --git a/docs/client/api.js b/docs/client/api.js index 1ca9cbce0fe..d7e9cfa033f 100644 --- a/docs/client/api.js +++ b/docs/client/api.js @@ -73,8 +73,7 @@ Template.api.release = { descr: ["`Meteor.release` is a string containing the name of the " + "[release](#meteorupdate) with which the project was built (for " + "example, `\"" + - // Put the current release in the docs as the example) - (Meteor.release ? Meteor.release : '0.6.0') + + Meteor.release + "\"`). It is `undefined` if the project was built using a git " + "checkout of Meteor."] }; @@ -89,9 +88,17 @@ Template.api.ejsonParse = { Template.api.ejsonStringify = { id: "ejson_stringify", - name: "EJSON.stringify(val)", + name: "EJSON.stringify(val, [options])", locus: "Anywhere", args: [ {name: "val", type: "EJSON-compatible value", descr: "A value to stringify."} ], + options: [ + {name: "indent", + type: "Boolean, Integer, or String", + descr: "Indents objects and arrays for easy readability. When `true`, indents by 2 spaces; when an integer, indents by that number of spaces; and when a string, uses the string as the indentation pattern."}, + {name: "canonical", + type: "Boolean", + descr: "When `true`, stringifies keys in an object in sorted order."} + ], descr: ["Serialize a value to a string.\n\nFor EJSON values, the serialization " + "fully represents the value. For non-EJSON values, serializes the " + "same way as `JSON.stringify`."] @@ -116,10 +123,15 @@ Template.api.ejsonToJSONValue = { Template.api.ejsonEquals = { id: "ejson_equals", - name: "EJSON.equals(a, b)", //doc options? + name: "EJSON.equals(a, b, [options])", locus: "Anywhere", args: [ {name: "a", type: "EJSON-compatible object"}, {name: "b", type: "EJSON-compatible object"} ], + options: [ + {name: "keyOrderSensitive", + type: "Boolean", + descr: "Compare in key sensitive order, if supported by the JavaScript implementation. For example, `{a: 1, b: 2}` is equal to `{b: 2, a: 1}` only when `keyOrderSensitive` is `false`. The default is `false`."} + ], descr: ["Return true if `a` and `b` are equal to each other. Return false otherwise." + " Uses the `equals` method on `a` if present, otherwise performs a deep comparison."] }, @@ -482,7 +494,7 @@ Template.api.meteor_collection = { options: [ {name: "connection", type: "Object", - descr: "The Meteor connection that will manage this collection. Uses the default connection if not specified. Pass `null` to specify no connection. Unmanaged (`name` is null) collections cannot specify a connection." + descr: "The server connection that will manage this collection. Uses the default connection if not specified. Pass the return value of calling [`DDP.connect`](#ddp_connect) to specify a different server. Pass `null` to specify no connection. Unmanaged (`name` is null) collections cannot specify a connection." }, {name: "idGeneration", type: "String", @@ -585,7 +597,7 @@ Template.api.update = { id: "update", name: "collection.update(selector, modifier, [options], [callback])", locus: "Anywhere", - descr: ["Modify one or more documents in the collection"], + descr: ["Modify one or more documents in the collection. Returns the number of affected documents."], args: [ {name: "selector", type: "Mongo selector, or object id", @@ -597,7 +609,37 @@ Template.api.update = { descr: "Specifies how to modify the documents"}, {name: "callback", type: "Function", - descr: "Optional. If present, called with an error object as its argument."} + descr: "Optional. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second."} + ], + options: [ + {name: "multi", + type: "Boolean", + descr: "True to modify all matching documents; false to only modify one of the matching documents (the default)."}, + {name: "upsert", + type: "Boolean", + descr: "True to insert a document if no matching documents are found."} + ] +}; + +Template.api.upsert = { + id: "upsert", + name: "collection.upsert(selector, modifier, [options], [callback])", + locus: "Anywhere", + descr: ["Modify one or more documents in the collection, or insert one if no matching documents were found. " + + "Returns an object with keys `numberAffected` (the number of documents modified) " + + " and `insertedId` (the unique _id of the document that was inserted, if any)."], + args: [ + {name: "selector", + type: "Mongo selector, or object id", + type_link: "selectors", + descr: "Specifies which documents to modify"}, + {name: "modifier", + type: "Mongo modifier", + type_link: "modifiers", + descr: "Specifies how to modify the documents"}, + {name: "callback", + type: "Function", + descr: "Optional. If present, called with an error object as the first argument and, if no error, the number of affected documents as the second."} ], options: [ {name: "multi", @@ -606,6 +648,7 @@ Template.api.update = { ] }; + Template.api.remove = { id: "remove", name: "collection.remove(selector, [callback])", @@ -675,25 +718,31 @@ Template.api.cursor_fetch = { Template.api.cursor_foreach = { id: "foreach", - name: "cursor.forEach(callback)", + name: "cursor.forEach(callback, [thisArg])", locus: "Anywhere", descr: ["Call `callback` once for each matching document, sequentially and synchronously."], args: [ {name: "callback", type: "Function", - descr: "Function to call."} + descr: "Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself."}, + {name: "thisArg", + type: "Any", + descr: "An object which will be the value of `this` inside `callback`."} ] }; Template.api.cursor_map = { id: "map", - name: "cursor.map(callback)", + name: "cursor.map(callback, [thisArg])", locus: "Anywhere", descr: ["Map callback over all matching documents. Returns an Array."], args: [ {name: "callback", type: "Function", - descr: "Function to call."} + descr: "Function to call. It will be called with three arguments: the document, a 0-based index, and cursor itself."}, + {name: "thisArg", + type: "Any", + descr: "An object which will be the value of `this` inside `callback`."} ] }; @@ -1026,6 +1075,20 @@ Template.api.logout = { ] }; +Template.api.logoutOtherClients = { + id: "meteor_logoutotherclients", + name: "Meteor.logoutOtherClients([callback])", + locus: "Client", + descr: ["Log out other clients logged in as the current user, but does not log out the client that calls this function."], + args: [ + { + name: "callback", + type: "Function", + descr: "Optional callback. Called with no arguments on success, or with a single `Error` argument on failure." + } + ] +}; + Template.api.loginWithPassword = { id: "meteor_loginwithpassword", @@ -1100,6 +1163,16 @@ Template.api.accounts_config = { name: "forbidClientAccountCreation", type: "Boolean", descr: "Calls to [`createUser`](#accounts_createuser) from the client will be rejected. In addition, if you are using [accounts-ui](#accountsui), the \"Create account\" link will not be available." + }, + { + name: "restrictCreationByEmailDomain", + type: "String Or Function", + descr: "If set, only allow new users with an email in the specified domain or if the predicate function returns true. Works with password-based sign-in and external services that expose email addresses (Google, Facebook, GitHub). All existing users still can log in after enabling this option. Example: `Accounts.config({ restrictCreationByEmailDomain: 'school.edu' })`." + }, + { + name: "loginExpirationInDays", + type: "Number", + descr: "The number of days from when a user logs in until their token expires and they are logged out. Defaults to 90. Set to `null` to disable login expiration." } ] }; diff --git a/docs/client/concepts.html b/docs/client/concepts.html index 61d47d7c18e..375bf90e9c7 100644 --- a/docs/client/concepts.html +++ b/docs/client/concepts.html @@ -824,9 +824,9 @@

Running on your own infrastructure

$ meteor bundle myapp.tgz This command will generate a fully-contained Node.js application in the form of -a tarball. To run this application, you need to provide Node.js 0.8 and a +a tarball. To run this application, you need to provide Node.js 0.10 and a MongoDB server. (The current release of Meteor has been tested with Node -0.8.24.) You can then run the application by invoking node, specifying the HTTP +0.10.20.) You can then run the application by invoking node, specifying the HTTP port for the application to listen on, and the MongoDB endpoint. If you don't already have a MongoDB server, we can recommend our friends at [MongoHQ](http://mongohq.com). diff --git a/docs/client/docs.js b/docs/client/docs.js index c057ef71bd1..f32972da78a 100644 --- a/docs/client/docs.js +++ b/docs/client/docs.js @@ -1,8 +1,5 @@ Template.headline.release = function () { - // XXX This is commented out because for now galaxy apps have to be on a - // different Meteor release that has a bug fix. - return "0.6.5.1"; - // return Meteor.release || "(checkout)"; + return Meteor.release || "(checkout)"; }; @@ -155,6 +152,7 @@ var toc = [ {instance: "collection", name: "findOne"}, {instance: "collection", name: "insert"}, {instance: "collection", name: "update"}, + {instance: "collection", name: "upsert"}, {instance: "collection", name: "remove"}, {instance: "collection", name: "allow"}, {instance: "collection", name: "deny"} @@ -191,6 +189,7 @@ var toc = [ "Meteor.users", "Meteor.loggingIn", "Meteor.logout", + "Meteor.logoutOtherClients", "Meteor.loginWithPassword", {name: "Meteor.loginWithFacebook", id: "meteor_loginwithexternalservice"}, {name: "Meteor.loginWithGithub", id: "meteor_loginwithexternalservice"}, @@ -335,6 +334,7 @@ var toc = [ "audit-argument-checks", "backbone", "bootstrap", + "browser-policy", "coffeescript", "d3", "force-ssl", diff --git a/docs/client/packages.html b/docs/client/packages.html index 0ee701bbe8f..077e4f1cd19 100644 --- a/docs/client/packages.html +++ b/docs/client/packages.html @@ -22,6 +22,7 @@

Packages

{{> pkg_audit_argument_checks}} {{> pkg_backbone}} {{> pkg_bootstrap}} +{{> pkg_browser_policy}} {{> pkg_coffeescript}} {{> pkg_d3}} {{> pkg_force_ssl}} diff --git a/docs/client/packages/browser-policy.html b/docs/client/packages/browser-policy.html new file mode 100644 index 00000000000..d89437e46e7 --- /dev/null +++ b/docs/client/packages/browser-policy.html @@ -0,0 +1,165 @@ +