Skip to content

Commit de7a147

Browse files
committed
Merge Tom's suggestions.
1 parent 2f0e505 commit de7a147

File tree

1 file changed

+3
-14
lines changed
  • google-cloud-firestore/src/main/java/com/google/cloud/firestore

1 file changed

+3
-14
lines changed

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

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -504,17 +504,7 @@ public Pipeline findNearest(
504504
FindNearest.DistanceMeasure distanceMeasure,
505505
FindNearestOptions options) {
506506
// Implementation for findNearest (add the FindNearest stage if needed)
507-
return new Pipeline(
508-
this.db,
509-
ImmutableList.<Stage>builder()
510-
.addAll(stages)
511-
.add(
512-
new FindNearest(
513-
property,
514-
vector,
515-
distanceMeasure,
516-
options)) // Assuming FindNearest takes these arguments
517-
.build());
507+
return append(new FindNearest(property, vector, distanceMeasure, options));
518508
}
519509

520510
/**
@@ -542,8 +532,7 @@ public Pipeline findNearest(
542532
*/
543533
@BetaApi
544534
public Pipeline sort(Ordering... orders) {
545-
return new Pipeline(
546-
this.db, ImmutableList.<Stage>builder().addAll(stages).add(new Sort(orders)).build());
535+
return append(new Sort(orders));
547536
}
548537

549538
/**
@@ -774,7 +763,7 @@ public void onComplete() {
774763
.addAnnotation(
775764
"Firestore.ExecutePipeline: Completed",
776765
ImmutableMap.of(
777-
"numDocuments", AttributeValue.longAttributeValue((long) totalNumDocuments)));
766+
"numDocuments", AttributeValue.longAttributeValue(numDocuments)));
778767
resultObserver.onCompleted(executionTime);
779768
}
780769
};

0 commit comments

Comments
 (0)