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
Add keys and excludeKeys options to REST docs (#649)
* Add `keys` and `excludeKeys` options to REST docs
* Add `.exclude()` example to JS Guide
Added example of Query.exclude() in `js/queries.md`
Closes#632
* Moved `keys` and `excludeKeys` from objects.md to queries.md
Also:
* Added `excludKeys` to the parameter table
* Added padding to <td> elements in `_normalize.scss`
* Fix typo
Copy file name to clipboardExpand all lines: _includes/rest/objects.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -140,7 +140,7 @@ The response body is a JSON object containing all the user-provided fields, plus
140
140
}
141
141
```
142
142
143
-
When retrieving objects that have pointers to children, you can fetch child objects by using the `include` option. For instance, to fetch the object pointed to by the "game" key:
143
+
When retrieving objects that have pointers to children, **you can fetch child objects** by using the `include` option. For instance, to fetch the object pointed to by the "game" key:
144
144
145
145
<divclass="language-toggle">
146
146
<pre><codeclass="bash">
@@ -192,6 +192,8 @@ print result
192
192
</code></pre>
193
193
</div>
194
194
195
+
196
+
195
197
## Updating Objects
196
198
197
199
To change the data on an object that already exists, send a PUT request to the object URL. Any keys you don't specify will remain unchanged, so you can update just a subset of the object's data. For example, if we wanted to change the score field of our object:
| limit | Limit the number of objects returned by the query |
309
+
| skip | Use with limit to paginate through results |
310
+
| keys | Restrict the fields returned by the query |
311
+
| excludeKeys | Exclude specific fields from the returned query |
312
+
| include | Use on Pointer columns to return the full object |
312
313
313
314
You can use the `order` parameter to specify a field to sort by. Prefixing with a negative sign reverses the order. Thus, to retrieve scores in ascending order:
314
315
@@ -411,7 +412,7 @@ print result
411
412
</code></pre>
412
413
</div>
413
414
414
-
You can restrict the fields returned by passing `keys` a comma-separated list. To retrieve documents that contain only the `score` and `playerName` fields (and also special built-in fields such as `objectId`, `createdAt`, and `updatedAt`):
415
+
You can restrict the fields returned by passing `keys`or `excludeKeys`a comma-separated list. To retrieve documents that contain only the `score` and `playerName` fields (and also special built-in fields such as `objectId`, `createdAt`, and `updatedAt`):
415
416
416
417
<divclass="language-toggle">
417
418
<pre><codeclass="bash">
@@ -436,6 +437,31 @@ print result
436
437
</code></pre>
437
438
</div>
438
439
440
+
Or you may use `excludeKeys` to fetch everything except `playerName`:
0 commit comments