Skip to content

Commit 392dd84

Browse files
committed
minor fixes
1 parent b27c5b8 commit 392dd84

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

google-cloud-firestore/src/main/java/com/google/cloud/firestore/PipelineUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,13 @@ static Pipeline toPaginatedPipeline(
161161
@InternalApi
162162
static AggregatorTarget toPipelineAggregatorTarget(AggregateField f) {
163163
String operator = f.getOperator();
164-
String fieldPath = f.getFieldPath(); // Assuming you have a method to get FieldPath
164+
String fieldPath = f.getFieldPath();
165165

166166
switch (operator) {
167167
case "sum":
168168
return Field.of(fieldPath)
169169
.sum()
170-
.toField(f.getAlias()); // Note: 'toField' is assumed to be a method in your context
170+
.toField(f.getAlias());
171171

172172
case "count":
173173
return countAll().toField(f.getAlias());

google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2160,7 +2160,7 @@ public Pipeline toPipeline() {
21602160
}
21612161

21622162
// Cursors, Limit and Offset
2163-
if (this.options.getStartCursor() != null || this.options.getEndCursor() != null) {
2163+
if (this.options.getStartCursor() != null || this.options.getEndCursor() != null || this.options.getLimitType() == LimitType.Last) {
21642164
ppl =
21652165
toPaginatedPipeline(
21662166
ppl,

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/FindNearest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ public static class FindNearestOptions {
106106

107107
private final Long limit;
108108
private final FindNearest.DistanceMeasure distanceMeasure;
109-
private final Field output;
109+
private final Field distanceField;
110110

111111
private FindNearestOptions(
112-
Long limit, FindNearest.DistanceMeasure distanceMeasure, Field output) {
112+
Long limit, FindNearest.DistanceMeasure distanceMeasure, Field distanceField) {
113113
this.limit = limit;
114114
this.distanceMeasure = distanceMeasure;
115-
this.output = output;
115+
this.distanceField = distanceField;
116116
}
117117

118118
public static FindNearest.FindNearestOptions newInstance(
@@ -128,8 +128,8 @@ public DistanceMeasure getDistanceMeasure() {
128128
return distanceMeasure;
129129
}
130130

131-
public Field getOutput() {
132-
return output;
131+
public Field getDistanceField() {
132+
return distanceField;
133133
}
134134
}
135135
}

google-cloud-firestore/src/main/java/com/google/cloud/firestore/pipeline/stages/StageUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static com.google.firestore.v1.Pipeline.Stage toStageProto(Stage stage) {
9494
.addArgs(encodeValue(findNearestStage.getVector()))
9595
.addArgs(encodeValue(findNearestStage.getOptions().getDistanceMeasure().toProtoString()))
9696
.putOptions("limit", encodeValue(findNearestStage.getOptions().getLimit()))
97-
.putOptions("distance_field", encodeValue(findNearestStage.getOptions().getOutput()))
97+
.putOptions("distance_field", encodeValue(findNearestStage.getOptions().getDistanceField()))
9898
.build();
9999
} else if (stage instanceof GenericStage) {
100100
GenericStage genericStage = (GenericStage) stage;

0 commit comments

Comments
 (0)