Skip to content

Commit b397923

Browse files
committed
Add support for WITH DATA_CATEGORY in SOQL and update sidebar positions for documentation
Signed-off-by: Piotr PG Gajek <[email protected]>
1 parent c8dd673 commit b397923

File tree

16 files changed

+365
-14
lines changed

16 files changed

+365
-14
lines changed
Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
---
2+
sidebar_position: 90
3+
---
4+
5+
# DataCategoryFilter
6+
7+
Specify and adjust single condition.
8+
9+
```apex
10+
SOQL.of(Knowledge__kav.SObjectType)
11+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
12+
.withDataCategory(
13+
SOQL.DataCategoryFilter
14+
.with('Geography__c')
15+
.aboveOrBelow('Europe__c')
16+
).toList();
17+
```
18+
19+
## Methods
20+
21+
The following are methods for `DataCategory Filter`.
22+
23+
[**FIELDS**](#fields)
24+
25+
- [`with(String field)`](#with-string-field)
26+
27+
[**COMPERATORS**](#comperators)
28+
29+
- [`at()`](#at)
30+
- [`above()`](#above)
31+
- [`below()`](#below)
32+
- [`aboveOrBelow()`](#aboveorbelow)
33+
34+
## FIELDS
35+
### with
36+
37+
**Signature**
38+
39+
```apex
40+
DataCategoryFilter with(String field);
41+
```
42+
43+
**Example**
44+
45+
```sql
46+
SELECT Id, Title
47+
FROM Knowledge__kav
48+
WITH DATA CATEGORY Geography__c ABOVE_OR_BELOW Europe__c
49+
```
50+
```apex
51+
SOQL.of(Knowledge__kav.SObjectType)
52+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
53+
.withDataCategory(
54+
SOQL.DataCategoryFilter
55+
.with('Geography__c')
56+
.aboveOrBelow('Europe__c')
57+
).toList();
58+
```
59+
60+
## COMPERATORS
61+
62+
### at
63+
64+
- `WITH DATA CATEGORY Geography__c AT Europe__c`
65+
66+
**Signature**
67+
68+
```apex
69+
DataCategoryFilter at(String category);
70+
DataCategoryFilter at(Iterable<String> categories);
71+
```
72+
73+
**Example**
74+
75+
```sql
76+
SELECT Id, Title
77+
FROM Knowledge__kav
78+
WITH DATA CATEGORY Geography__c AT Europe__c
79+
```
80+
```apex
81+
SOQL.of(Knowledge__kav.SObjectType)
82+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
83+
.withDataCategory(
84+
SOQL.DataCategoryFilter
85+
.with('Geography__c')
86+
.at('Europe__c')
87+
).toList();
88+
```
89+
90+
```sql
91+
SELECT Id, Title
92+
FROM Knowledge__kav
93+
WITH DATA CATEGORY Geography__c AT (Europe__c, North_America__c)
94+
```
95+
```apex
96+
SOQL.of(Knowledge__kav.SObjectType)
97+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
98+
.withDataCategory(
99+
SOQL.DataCategoryFilter
100+
.with('Geography__c')
101+
.at(new List<String>{ 'Europe__c', 'North_America__c' })
102+
).toList();
103+
```
104+
105+
### above
106+
107+
- `WITH DATA CATEGORY Geography__c ABOVE Europe__c`
108+
109+
**Signature**
110+
111+
```apex
112+
DataCategoryFilter above(String category);
113+
DataCategoryFilter above(Iterable<String> categories);
114+
```
115+
116+
**Example**
117+
118+
```sql
119+
SELECT Id, Title
120+
FROM Knowledge__kav
121+
WITH DATA CATEGORY Geography__c ABOVE Europe__c
122+
```
123+
```apex
124+
SOQL.of(Knowledge__kav.SObjectType)
125+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
126+
.withDataCategory(
127+
SOQL.DataCategoryFilter
128+
.with('Geography__c')
129+
.above('Europe__c')
130+
).toList();
131+
```
132+
133+
```sql
134+
SELECT Id, Title
135+
FROM Knowledge__kav
136+
WITH DATA CATEGORY Geography__c ABOVE (Europe__c, North_America__c)
137+
```
138+
```apex
139+
SOQL.of(Knowledge__kav.SObjectType)
140+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
141+
.withDataCategory(
142+
SOQL.DataCategoryFilter
143+
.with('Geography__c')
144+
.above(new List<String>{ 'Europe__c', 'North_America__c' })
145+
).toList();
146+
```
147+
148+
### below
149+
150+
- `WITH DATA CATEGORY Geography__c BELOW Europe__c`
151+
152+
**Signature**
153+
154+
```apex
155+
DataCategoryFilter below(String category);
156+
DataCategoryFilter below(Iterable<String> categories);
157+
```
158+
159+
**Example**
160+
161+
```sql
162+
SELECT Id, Title
163+
FROM Knowledge__kav
164+
WITH DATA CATEGORY Geography__c BELOW Europe__c
165+
```
166+
```apex
167+
SOQL.of(Knowledge__kav.SObjectType)
168+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
169+
.withDataCategory(
170+
SOQL.DataCategoryFilter
171+
.with('Geography__c')
172+
.below('Europe__c')
173+
).toList();
174+
```
175+
176+
```sql
177+
SELECT Id, Title
178+
FROM Knowledge__kav
179+
WITH DATA CATEGORY Geography__c BELOW (Europe__c, North_America__c)
180+
```
181+
```apex
182+
SOQL.of(Knowledge__kav.SObjectType)
183+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
184+
.withDataCategory(
185+
SOQL.DataCategoryFilter
186+
.with('Geography__c')
187+
.below(new List<String>{ 'Europe__c', 'North_America__c' })
188+
).toList();
189+
```
190+
191+
### aboveOrBelow
192+
193+
- `WITH DATA CATEGORY Geography__c ABOVE_OR_BELOW Europe__c`
194+
195+
**Signature**
196+
197+
```apex
198+
DataCategoryFilter aboveOrBelow(String category);
199+
DataCategoryFilter aboveOrBelow(Iterable<String> categories);
200+
```
201+
202+
**Example**
203+
204+
```sql
205+
SELECT Id, Title
206+
FROM Knowledge__kav
207+
WITH DATA CATEGORY Geography__c ABOVE_OR_BELOW Europe__c
208+
```
209+
```apex
210+
SOQL.of(Knowledge__kav.SObjectType)
211+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
212+
.withDataCategory(
213+
SOQL.DataCategoryFilter
214+
.with('Geography__c')
215+
.aboveOrBelow('Europe__c')
216+
).toList();
217+
```
218+
219+
```sql
220+
SELECT Id, Title
221+
FROM Knowledge__kav
222+
WITH DATA CATEGORY Geography__c ABOVE_OR_BELOW (Europe__c, North_America__c)
223+
```
224+
```apex
225+
SOQL.of(Knowledge__kav.SObjectType)
226+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
227+
.withDataCategory(
228+
SOQL.DataCategoryFilter
229+
.with('Geography__c')
230+
.aboveOrBelow(new List<String>{ 'Europe__c', 'North_America__c' })
231+
).toList();
232+
```

website/docs/api/standard-soql/soql.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ The following are methods for using `SOQL`:
115115
- [`groupByCube(SObjectField field)`](#groupbycube)
116116
- [`groupByCube(String relationshipName, SObjectField field)`](#groupbycube-related)
117117

118+
[**WITH DATA_CATEGORY**]
119+
120+
- [`withDataCategory(DataCategoryFilter dataCategoryFilter)`](#with-data_category)
121+
118122
[**HAVING**](#having)
119123

120124
- [`have(HavingFilterGroup filterGroup)`](#have)
@@ -1475,6 +1479,31 @@ SOQL.of(Lead.SObjectType)
14751479
.toAggregated();
14761480
```
14771481

1482+
## WITH DATA_CATEGORY
1483+
1484+
For more details check [SOQL.DataCategoryFilter](#soql-data-category-filter.md).
1485+
1486+
**Signature**
1487+
1488+
```apex
1489+
Queryable withDataCategory(DataCategoryFilter dataCategoryFilter);
1490+
```
1491+
1492+
**Example**
1493+
1494+
```sql
1495+
SELECT Id, Title
1496+
FROM Knowledge__kav
1497+
WITH DATA CATEGORY Geography__c AT (Europe__c, North_America__c)
1498+
```
1499+
1500+
```apex
1501+
SOQL.of(Knowledge__kav.SObjectType)
1502+
.with(Knowledge__kav.Id, Knowledge__kav.Title)
1503+
.withDataCategory(SOQL.DataCategoryFilter.with('Geography__c').at(new List<String>{ 'Europe__c', 'North_America__c' }))
1504+
.toList();
1505+
```
1506+
14781507
## HAVING
14791508

14801509
### have

website/docs/examples/standard-soql/aggregate-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 3
2+
sidebar_position: 30
33
---
44

55
# AGGREGATE FUNCTIONS

website/docs/examples/standard-soql/debug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 14
2+
sidebar_position: 140
33
---
44

55
# DEBUGGING

website/docs/examples/standard-soql/fls.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 11
2+
sidebar_position: 110
33
---
44

55
# FIELD-LEVEL SECURITY

website/docs/examples/standard-soql/group-by.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 7
2+
sidebar_position: 70
33
---
44

55
# GROUP BY

website/docs/examples/standard-soql/limit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 9
2+
sidebar_position: 90
33
---
44

55
# LIMIT

website/docs/examples/standard-soql/mocking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 13
2+
sidebar_position: 130
33
---
44

55
# MOCKING

website/docs/examples/standard-soql/order-by.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 8
2+
sidebar_position: 80
33
---
44

55
# ORDER BY

website/docs/examples/standard-soql/result.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 15
2+
sidebar_position: 150
33
---
44

55
# RESULT

0 commit comments

Comments
 (0)