File tree Expand file tree Collapse file tree 4 files changed +9
-9
lines changed
google-cloud-firestore/src/main/java/com/google/cloud/firestore Expand file tree Collapse file tree 4 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -161,13 +161,13 @@ static Pipeline toPaginatedPipeline(
161
161
@ InternalApi
162
162
static AggregatorTarget toPipelineAggregatorTarget (AggregateField f ) {
163
163
String operator = f .getOperator ();
164
- String fieldPath = f .getFieldPath (); // Assuming you have a method to get FieldPath
164
+ String fieldPath = f .getFieldPath ();
165
165
166
166
switch (operator ) {
167
167
case "sum" :
168
168
return Field .of (fieldPath )
169
169
.sum ()
170
- .toField (f .getAlias ()); // Note: 'toField' is assumed to be a method in your context
170
+ .toField (f .getAlias ());
171
171
172
172
case "count" :
173
173
return countAll ().toField (f .getAlias ());
Original file line number Diff line number Diff line change @@ -2160,7 +2160,7 @@ public Pipeline toPipeline() {
2160
2160
}
2161
2161
2162
2162
// 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 ) {
2164
2164
ppl =
2165
2165
toPaginatedPipeline (
2166
2166
ppl ,
Original file line number Diff line number Diff line change @@ -106,13 +106,13 @@ public static class FindNearestOptions {
106
106
107
107
private final Long limit ;
108
108
private final FindNearest .DistanceMeasure distanceMeasure ;
109
- private final Field output ;
109
+ private final Field distanceField ;
110
110
111
111
private FindNearestOptions (
112
- Long limit , FindNearest .DistanceMeasure distanceMeasure , Field output ) {
112
+ Long limit , FindNearest .DistanceMeasure distanceMeasure , Field distanceField ) {
113
113
this .limit = limit ;
114
114
this .distanceMeasure = distanceMeasure ;
115
- this .output = output ;
115
+ this .distanceField = distanceField ;
116
116
}
117
117
118
118
public static FindNearest .FindNearestOptions newInstance (
@@ -128,8 +128,8 @@ public DistanceMeasure getDistanceMeasure() {
128
128
return distanceMeasure ;
129
129
}
130
130
131
- public Field getOutput () {
132
- return output ;
131
+ public Field getDistanceField () {
132
+ return distanceField ;
133
133
}
134
134
}
135
135
}
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ public static com.google.firestore.v1.Pipeline.Stage toStageProto(Stage stage) {
94
94
.addArgs (encodeValue (findNearestStage .getVector ()))
95
95
.addArgs (encodeValue (findNearestStage .getOptions ().getDistanceMeasure ().toProtoString ()))
96
96
.putOptions ("limit" , encodeValue (findNearestStage .getOptions ().getLimit ()))
97
- .putOptions ("distance_field" , encodeValue (findNearestStage .getOptions ().getOutput ()))
97
+ .putOptions ("distance_field" , encodeValue (findNearestStage .getOptions ().getDistanceField ()))
98
98
.build ();
99
99
} else if (stage instanceof GenericStage ) {
100
100
GenericStage genericStage = (GenericStage ) stage ;
You can’t perform that action at this time.
0 commit comments