|
1 | 1 | /* |
2 | | - * hook-javascript v0.1.0 |
| 2 | + * hook-javascript v0.2.1 |
3 | 3 | * https://github.com/doubleleft/hook-javascript |
4 | 4 | * |
5 | 5 | * @copyright 2014 Doubleleft |
6 | | - * @build 11/5/2014 |
| 6 | + * @build 11/11/2014 |
7 | 7 | */ |
8 | 8 | (function(window) { |
9 | 9 | // |
@@ -9917,7 +9917,7 @@ Hook.Client.prototype.getHeaders = function() { |
9917 | 9917 | // App authentication request headers |
9918 | 9918 | var request_headers = { |
9919 | 9919 | 'X-App-Id': this.app_id, |
9920 | | - 'X-App-Key': this.key, |
| 9920 | + 'X-App-Key': this.key |
9921 | 9921 | }, auth_token; |
9922 | 9922 |
|
9923 | 9923 | // Forward user authentication token, if it is set |
@@ -10606,33 +10606,33 @@ Hook.Collection.prototype.find = function(_id) { |
10606 | 10606 |
|
10607 | 10607 | /** |
10608 | 10608 | * Set the relationships that should be eager loaded. |
10609 | | - * @method with |
| 10609 | + * @method join |
10610 | 10610 | * @param {String} ... |
10611 | 10611 | * @return {Hook.Collection} |
10612 | 10612 | * |
10613 | 10613 | * @example Simple relationship |
10614 | 10614 | * |
10615 | | - * client.collection('books').with('author').each(function(book) { |
| 10615 | + * client.collection('books').join('author').each(function(book) { |
10616 | 10616 | * console.log("Author: ", book.author.name); |
10617 | 10617 | * }); |
10618 | 10618 | * |
10619 | 10619 | * @example Multiple relationships |
10620 | 10620 | * |
10621 | | - * client.collection('books').with('author', 'publisher').each(function(book) { |
| 10621 | + * client.collection('books').join('author', 'publisher').each(function(book) { |
10622 | 10622 | * console.log("Author: ", book.author.name); |
10623 | 10623 | * console.log("Publisher: ", book.publisher.name); |
10624 | 10624 | * }); |
10625 | 10625 | * |
10626 | 10626 | * @example Nested relationships |
10627 | 10627 | * |
10628 | | - * client.collection('books').with('author.contacts').each(function(book) { |
| 10628 | + * client.collection('books').join('author.contacts').each(function(book) { |
10629 | 10629 | * console.log("Author: ", book.author.name); |
10630 | 10630 | * console.log("Contacts: ", book.author.contacts); |
10631 | 10631 | * }); |
10632 | 10632 | * |
10633 | 10633 | */ |
10634 | | -Hook.Collection.prototype.with = function() { |
10635 | | - this.options.with = arguments; |
| 10634 | +Hook.Collection.prototype.join = function() { |
| 10635 | + this.options['with'] = arguments; |
10636 | 10636 | return this; |
10637 | 10637 | }; |
10638 | 10638 |
|
@@ -11136,7 +11136,7 @@ Hook.Collection.prototype.buildQuery = function() { |
11136 | 11136 | aggregation: 'aggr', // min / max / count / avg / sum |
11137 | 11137 | operation: 'op', // increment / decrement |
11138 | 11138 | data: 'data', // updateAll / firstOrCreate |
11139 | | - with: 'with', // relationships |
| 11139 | + with: 'with', // join / relationships |
11140 | 11140 | select: 'select', // fields to return |
11141 | 11141 | distinct: 'distinct' // use distinct operation |
11142 | 11142 | }; |
|
0 commit comments