Skip to content

Commit 1988135

Browse files
authored
update filter example (#31)
1 parent 49ba7df commit 1988135

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

docs_code_snippets/04_01_feeds.dart

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,12 @@ Future<void> filteringExamples() async {
120120
}
121121

122122
Future<void> moreComplexFilterExamples() async {
123-
// Get all the activities where tags contain "green" and type is "post" or tag contains "orange" and type is "activity"
123+
// Get all the activities where filter tags contain both "green" and "orange"
124124
const query = FeedQuery(
125125
fid: FeedId(group: 'user', id: 'john'),
126-
activityFilter: Filter.or([
127-
Filter.and([
128-
Filter.in_(ActivitiesFilterField.filterTags, ['green']),
129-
Filter.equal(ActivitiesFilterField.type, 'post'),
130-
]),
131-
Filter.and([
132-
Filter.in_(ActivitiesFilterField.filterTags, ['orange']),
133-
Filter.equal(ActivitiesFilterField.type, 'activity'),
134-
]),
126+
activityFilter: Filter.and([
127+
Filter.in_(ActivitiesFilterField.filterTags, ['green']),
128+
Filter.in_(ActivitiesFilterField.filterTags, ['orange']),
135129
]),
136130
);
137131

0 commit comments

Comments
 (0)