Skip to content

Commit cff264d

Browse files
committed
docs: remove fields filter warning
1 parent ccea25f commit cff264d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

docs/site/Fields-filter.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ query will include **only** those you specifically include with filters.
2727

2828
### REST API
2929

30-
{% include warning.html content="
31-
As a known bug, the option `<false>` does not work for url for now. Please include the properties you need or use the [stringified JSON format](Querying-data.html#using-stringified-json-in-rest-queries) to meet your requirement. The bug is tracked in the GH issue [#4992](https://github.com/strongloop/loopback-next/issues/4992)" %}
32-
3330
<pre>
34-
filter[fields][<i>propertyName</i>]=true&filter[fields][<i>propertyName</i>]=true...
31+
filter[fields][<i>propertyName</i>]=true|false&filter[fields][<i>propertyName</i>]=true|false...
3532
</pre>
3633

3734
Note that to include more than one field in REST, use multiple filters.
@@ -50,14 +47,18 @@ Return customer information only with `name` and `address`, and hide their `id`:
5047
await customerRepository.find({fields: {id: false, name: true, address: true}});
5148
```
5249

50+
Or use stringified JSON format:
51+
52+
`/orders?filter={"fields":{"name":true,"address":true,"id":false}}`
53+
5354
{% include code-caption.html content="REST" %}
5455

55-
Include all required properties as a workaround:
56+
Include all required properties:
5657
`/customers?filter[fields][name]=true&filter[fields][address]=true`
5758

58-
Or use stringified JSON format:
59+
Or omit the hidden property:
5960

60-
`/orders?filter={"fields":{"name":true,"address":true,"id":false}}`
61+
`/customers?filter[fields][id]=false`
6162

6263
Returns:
6364

0 commit comments

Comments
 (0)