@@ -80,8 +80,8 @@ function _findAll(resourceName, params, options) {
80
80
* @id DS.async_methods:findAll
81
81
* @name findAll
82
82
* @description
83
- * Asynchronously return the resource from the server filtered by the query. The results will be added to the data
84
- * store when it returns from the server .
83
+ * The "R" in "CRUD". Delegate to the `findAll` method of whichever adapter is being used (http by default) and inject
84
+ * the resulting collection into the data store .
85
85
*
86
86
* ## Signature:
87
87
* ```js
@@ -91,46 +91,44 @@ function _findAll(resourceName, params, options) {
91
91
* ## Example:
92
92
*
93
93
* ```js
94
- * var params = {
95
- * where: {
96
- * author: {
97
- * '==': 'John Anderson'
98
- * }
99
- * }
100
- * };
94
+ * var params = {
95
+ * where: {
96
+ * author: {
97
+ * '==': 'John Anderson'
98
+ * }
99
+ * }
100
+ * };
101
101
*
102
- * DS.findAll('document', params).then(function (documents) {
103
- * documents; // [{ id: '1', author: 'John Anderson', title: 'How to cook' },
104
- * // { id: '2', author: 'John Anderson', title: 'How NOT to cook' }]
102
+ * DS.filter('document', params); // []
103
+ * DS.findAll('document', params).then(function (documents) {
104
+ * documents; // [{ id: '1', author: 'John Anderson', title: 'How to cook' },
105
+ * // { id: '2', author: 'John Anderson', title: 'How NOT to cook' }]
105
106
*
106
- * // The documents are now in the data store
107
- * DS.filter('document', params); // [{ id: '1', author: 'John Anderson', title: 'How to cook' },
108
- * // { id: '2', author: 'John Anderson', title: 'How NOT to cook' }]
109
- *
110
- * }, function (err) {
111
- * // handle error
112
- * });
107
+ * // The documents are now in the data store
108
+ * DS.filter('document', params); // [{ id: '1', author: 'John Anderson', title: 'How to cook' },
109
+ * // { id: '2', author: 'John Anderson', title: 'How NOT to cook' }]
110
+ * });
113
111
* ```
114
112
*
115
113
* @param {string } resourceName The resource type, e.g. 'user', 'comment', etc.
116
- * @param {object= } params Parameter object that is serialized into the query string. Properties :
114
+ * @param {object= } params Parameter object that is serialized into the query string. Default properties :
117
115
*
118
116
* - `{object=}` - `where` - Where clause.
119
117
* - `{number=}` - `limit` - Limit clause.
120
118
* - `{number=}` - `skip` - Skip clause.
121
119
* - `{number=}` - `offset` - Same as skip.
122
120
* - `{string|array=}` - `orderBy` - OrderBy clause.
123
121
*
124
- * @param {object= } options Optional configuration. Properties:
122
+ * @param {object= } options Optional configuration. Also passed along to the adapter's `findAll` method. Properties:
125
123
*
126
124
* - `{boolean=}` - `bypassCache` - Bypass the cache. Default: `false`.
127
- * - `{boolean=}` - `cacheResponse` - Inject the data returned by the server into the data store. Default: `true`.
125
+ * - `{boolean=}` - `cacheResponse` - Inject the data returned by the adapter into the data store. Default: `true`.
128
126
*
129
127
* @returns {Promise } Promise produced by the `$q` service.
130
128
*
131
129
* ## Resolves with:
132
130
*
133
- * - `{array}` - `items` - The collection of items returned by the server .
131
+ * - `{array}` - `items` - The collection of items returned by the adapter .
134
132
*
135
133
* ## Rejects with:
136
134
*
0 commit comments