You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/release/models/finding-records.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ Use [`store.peekRecord()`](https://api.emberjs.com/ember-data/release/classes/St
19
19
This will return the record only if it is already present in the store:
20
20
21
21
```javascript
22
-
let blogPost =this.store.peekRecord('blog-post', 1); // => no network request
22
+
let blogPost =this.store.peekRecord('blog-post', '1'); // => no network request
23
23
```
24
24
25
25
### Retrieving Multiple Records
@@ -40,7 +40,7 @@ Use [`store.peekAll()`](https://api.emberjs.com/ember-data/release/classes/Store
40
40
let blogPosts =this.store.peekAll('blog-post'); // => no network request
41
41
```
42
42
43
-
`findRecord()` returns a `PromiseArray` that fulfills to a `RecordArray` and `store.peekAll` directly returns a `RecordArray`.
43
+
`findRecord()` returns a `response` which has the record and `store.peekAll` directly returns a `RecordArray`.
44
44
45
45
It's important to note that `RecordArray` is not a JavaScript array, it's an object that implements [`MutableArray`](https://api.emberjs.com/ember/release/classes/MutableArray).
46
46
This is important because, for example, if you want to retrieve records by index,
@@ -104,8 +104,9 @@ Then, calling `queryData()` will retrieve that object from the server:
0 commit comments