Skip to content

Commit 19b3eb1

Browse files
committed
Start adding or
First idea for parse-community#213 Works with normal Query and LiveQuery. Missing: - any kind of "UserError handling" - further testing
1 parent 0f4a650 commit 19b3eb1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/src/network/parse_query.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ class QueryBuilder<T extends ParseObject> {
55
/// Class to create complex queries
66
QueryBuilder(this.object) : super();
77

8+
QueryBuilder.or(this.object, List<QueryBuilder<T>> list) {
9+
String query = '"\$or":[';
10+
for (int i = 0; i < list.length; ++i) {
11+
if (i > 0) query += ',';
12+
query += '{' + list[i].buildQueries(list[i].queries) + '}';
13+
}
14+
query += ']';
15+
print(query);
16+
queries.add(MapEntry<String, dynamic>(_NO_OPERATOR_NEEDED, query));
17+
}
18+
819
static const String _NO_OPERATOR_NEEDED = 'NO_OP';
920
static const String _SINGLE_QUERY = 'SINGLE_QUERY';
1021

0 commit comments

Comments
 (0)