Skip to content

Make count queries publicly available for use #4126

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

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions firebase-firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ by opting into a release at

# Unreleased
- [fixed] Fixed an issue `waitForPendingWrites()` could lead to NullPointerException.
- [feature] Added Query.count(), which fetches the number of documents in the
result set without actually downloading the documents (#4126).

# 24.2.0
- [feature] Added `TransactionOptions` to control how many times a transaction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* in test mocks. Subclassing is not supported in production code and new SDK releases may break
* code that does so.
*/
class AggregateQuery {
public class AggregateQuery {
// The base query.
private final Query query;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* in test mocks. Subclassing is not supported in production code and new SDK releases may break
* code that does so.
*/
class AggregateQuerySnapshot {
public class AggregateQuerySnapshot {

private final long count;
private final AggregateQuery query;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package com.google.firebase.firestore;

/** Configures the behavior of {@link AggregateQuery#get}. */
enum AggregateSource {
public enum AggregateSource {
/**
* Reach to the Firestore backend and surface the result verbatim, that is no local documents or
* mutations in the SDK cache will be included in the surfaced result.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ private void validateHasExplicitOrderByForLimitToLast() {
* the result set of this query.
*/
@NonNull
AggregateQuery count() {
public AggregateQuery count() {
return new AggregateQuery(this);
}

Expand Down