Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public sum/avg #5217

Merged
merged 19 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions firebase-firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased
* [fixed] Implement equals method on Filter class. [#5210](//github.com/firebase/firebase-android-sdk/issues/5210)
* [feature] Expose Sum/Average aggregate query support in API. [#5217](//github.com/firebase/firebase-android-sdk/pull/5217)

# 24.7.0
* [feature] Expose MultiDb support in API. [#4015](//github.com/firebase/firebase-android-sdk/issues/4015)
Expand Down
27 changes: 27 additions & 0 deletions firebase-firestore/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,39 @@ package com.google.firebase {

package com.google.firebase.firestore {

public abstract class AggregateField {
method @NonNull public static com.google.firebase.firestore.AggregateField.AverageAggregateField average(@NonNull String);
method @NonNull public static com.google.firebase.firestore.AggregateField.AverageAggregateField average(@NonNull com.google.firebase.firestore.FieldPath);
method @NonNull public static com.google.firebase.firestore.AggregateField.CountAggregateField count();
method @NonNull @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public String getAlias();
method @NonNull @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public String getFieldPath();
method @NonNull @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public String getOperator();
method @NonNull public static com.google.firebase.firestore.AggregateField.SumAggregateField sum(@NonNull String);
method @NonNull public static com.google.firebase.firestore.AggregateField.SumAggregateField sum(@NonNull com.google.firebase.firestore.FieldPath);
}

public static class AggregateField.AverageAggregateField extends com.google.firebase.firestore.AggregateField {
}

public static class AggregateField.CountAggregateField extends com.google.firebase.firestore.AggregateField {
}

public static class AggregateField.SumAggregateField extends com.google.firebase.firestore.AggregateField {
}

public class AggregateQuery {
method @NonNull public com.google.android.gms.tasks.Task<com.google.firebase.firestore.AggregateQuerySnapshot> get(@NonNull com.google.firebase.firestore.AggregateSource);
method @NonNull @RestrictTo(androidx.annotation.RestrictTo.Scope.LIBRARY) public java.util.List<com.google.firebase.firestore.AggregateField> getAggregateFields();
method @NonNull public com.google.firebase.firestore.Query getQuery();
}

public class AggregateQuerySnapshot {
method @Nullable public Object get(@NonNull com.google.firebase.firestore.AggregateField);
method public long get(@NonNull com.google.firebase.firestore.AggregateField.CountAggregateField);
method @Nullable public Double get(@NonNull com.google.firebase.firestore.AggregateField.AverageAggregateField);
method public long getCount();
method @Nullable public Double getDouble(@NonNull com.google.firebase.firestore.AggregateField);
method @Nullable public Long getLong(@NonNull com.google.firebase.firestore.AggregateField);
method @NonNull public com.google.firebase.firestore.AggregateQuery getQuery();
}

Expand Down Expand Up @@ -378,6 +404,7 @@ package com.google.firebase.firestore {
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull com.google.firebase.firestore.MetadataChanges, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>);
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull java.util.concurrent.Executor, @NonNull com.google.firebase.firestore.MetadataChanges, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>);
method @NonNull public com.google.firebase.firestore.ListenerRegistration addSnapshotListener(@NonNull android.app.Activity, @NonNull com.google.firebase.firestore.MetadataChanges, @NonNull com.google.firebase.firestore.EventListener<com.google.firebase.firestore.QuerySnapshot>);
method @NonNull public com.google.firebase.firestore.AggregateQuery aggregate(@NonNull com.google.firebase.firestore.AggregateField, @NonNull com.google.firebase.firestore.AggregateField...);
method @NonNull public com.google.firebase.firestore.AggregateQuery count();
method @NonNull public com.google.firebase.firestore.Query endAt(@NonNull com.google.firebase.firestore.DocumentSnapshot);
method @NonNull public com.google.firebase.firestore.Query endAt(java.lang.Object...);
Expand Down
Loading