Skip to content

Commit 06d72b4

Browse files
committed
Update functions with variadic params to match signatures of the backend
1 parent ac42e1f commit 06d72b4

File tree

6 files changed

+356
-401
lines changed

6 files changed

+356
-401
lines changed

packages/firestore/src/api_pipelines.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export {
107107
genericFunction,
108108
ascending,
109109
descending,
110-
countif,
110+
countIf,
111111
bitAnd,
112112
bitOr,
113113
bitXor,
@@ -133,7 +133,7 @@ export {
133133
key,
134134
substr,
135135
manhattanDistance,
136-
Countif,
136+
CountIf,
137137
BitAnd,
138138
BitOr,
139139
BitXor,

packages/firestore/src/core/pipeline-util.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,16 @@ export function toPipelineBooleanExpr(f: FilterInternal): BooleanExpr {
135135
} else if (f instanceof CompositeFilterInternal) {
136136
switch (f.op) {
137137
case CompositeOperator.AND: {
138-
const conditions = f
139-
.getFilters()
140-
.map(f => toPipelineBooleanExpr(f));
141-
return andFunction(conditions[0], ...conditions.slice(1));
138+
const conditions = f.getFilters().map(f => toPipelineBooleanExpr(f));
139+
return andFunction(
140+
conditions[0],
141+
conditions[1],
142+
...conditions.slice(2)
143+
);
142144
}
143145
case CompositeOperator.OR: {
144-
const conditions = f
145-
.getFilters()
146-
.map(f => toPipelineBooleanExpr(f));
147-
return orFunction(conditions[0], ...conditions.slice(1));
146+
const conditions = f.getFilters().map(f => toPipelineBooleanExpr(f));
147+
return orFunction(conditions[0], conditions[1], ...conditions.slice(2));
148148
}
149149
default:
150150
fail('Unexpected operator');

0 commit comments

Comments
 (0)