Skip to content

Commit 789eeb9

Browse files
committed
Copy the latest pipelines tests into lite api pipelines tests. Fix a few minor bugs in the lite pipeline implementation
1 parent 8627523 commit 789eeb9

File tree

4 files changed

+1699
-339
lines changed

4 files changed

+1699
-339
lines changed

packages/firestore/lite/pipelines/pipelines.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,27 @@ export {
160160
timestampSubtract,
161161
ascending,
162162
descending,
163+
arrayGet,
164+
abs,
165+
sum,
166+
countDistinct,
167+
ceil,
168+
floor,
169+
exp,
170+
pow,
171+
round,
172+
collectionId,
173+
ln,
174+
log,
175+
sqrt,
176+
stringReverse,
177+
log10,
178+
concat,
179+
currentTimestamp,
180+
error,
181+
ifAbsent,
182+
join,
183+
arraySum,
163184
AliasedExpression,
164185
Field,
165186
Constant,

packages/firestore/src/remote/datastore.ts

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,17 @@ export async function invokeExecutePipeline(
263263
);
264264

265265
const result: PipelineStreamElement[] = [];
266-
response
267-
.filter(proto => !!proto.results)
268-
.forEach(proto => {
269-
if (proto.results!.length === 0) {
270-
result.push(fromPipelineResponse(datastoreImpl.serializer, proto));
271-
} else {
272-
return proto.results!.forEach(document =>
273-
result.push(
274-
fromPipelineResponse(datastoreImpl.serializer, proto, document)
275-
)
276-
);
277-
}
278-
});
266+
response.forEach(proto => {
267+
if (!proto.results || proto.results!.length === 0) {
268+
result.push(fromPipelineResponse(datastoreImpl.serializer, proto));
269+
} else {
270+
return proto.results!.forEach(document =>
271+
result.push(
272+
fromPipelineResponse(datastoreImpl.serializer, proto, document)
273+
)
274+
);
275+
}
276+
});
279277

280278
return result;
281279
}

0 commit comments

Comments
 (0)