Skip to content

feat: Add support for new Firestore types #6928

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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: 1 addition & 1 deletion firebase-firestore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Unreleased

* [feature] Add support for the following new types: MinKey, MaxKey, RegexValue, Int32Value, BsonObjectId, BsonTimestamp, and BsonBinaryData. [#6928](//github.com/firebase/firebase-android-sdk/pull/6928)

# 25.1.4
* [fixed] Fixed the `null` value handling in `whereNotEqualTo` and `whereNotIn` filters.
Expand Down
45 changes: 45 additions & 0 deletions firebase-firestore/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ package com.google.firebase.firestore {
method public byte[] toBytes();
}

public final class BsonBinaryData {
method public com.google.protobuf.ByteString dataAsByteString();
method public byte[] dataAsBytes();
method public static com.google.firebase.firestore.BsonBinaryData fromByteString(int, com.google.protobuf.ByteString);
method public static com.google.firebase.firestore.BsonBinaryData fromBytes(int, byte[]);
method public int subtype();
}

public final class BsonObjectId {
ctor public BsonObjectId(String);
field public final String! value;
}

public final class BsonTimestamp {
ctor public BsonTimestamp(long, long);
field public final long increment;
field public final long seconds;
}

public class CollectionReference extends com.google.firebase.firestore.Query {
method public com.google.android.gms.tasks.Task<com.google.firebase.firestore.DocumentReference!> add(Object);
method public com.google.firebase.firestore.DocumentReference document();
Expand Down Expand Up @@ -109,6 +128,9 @@ package com.google.firebase.firestore {
method public <T> T? get(String, Class<T!>, com.google.firebase.firestore.DocumentSnapshot.ServerTimestampBehavior);
method public com.google.firebase.firestore.Blob? getBlob(String);
method public Boolean? getBoolean(String);
method public com.google.firebase.firestore.BsonBinaryData? getBsonBinaryData(String);
method public com.google.firebase.firestore.BsonObjectId? getBsonObjectId(String);
method public com.google.firebase.firestore.BsonTimestamp? getBsonTimestamp(String);
method public java.util.Map<java.lang.String!,java.lang.Object!>? getData();
method public java.util.Map<java.lang.String!,java.lang.Object!>? getData(com.google.firebase.firestore.DocumentSnapshot.ServerTimestampBehavior);
method public java.util.Date? getDate(String);
Expand All @@ -117,9 +139,13 @@ package com.google.firebase.firestore {
method public Double? getDouble(String);
method public com.google.firebase.firestore.GeoPoint? getGeoPoint(String);
method public String getId();
method public com.google.firebase.firestore.Int32Value? getInt32Value(String);
method public Long? getLong(String);
method public com.google.firebase.firestore.MaxKey? getMaxKey(String);
method public com.google.firebase.firestore.SnapshotMetadata getMetadata();
method public com.google.firebase.firestore.MinKey? getMinKey(String);
method public com.google.firebase.firestore.DocumentReference getReference();
method public com.google.firebase.firestore.RegexValue? getRegexValue(String);
method public String? getString(String);
method public com.google.firebase.Timestamp? getTimestamp(String);
method public com.google.firebase.Timestamp? getTimestamp(String, com.google.firebase.firestore.DocumentSnapshot.ServerTimestampBehavior);
Expand Down Expand Up @@ -303,6 +329,11 @@ package com.google.firebase.firestore {
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.TYPE}) public @interface IgnoreExtraProperties {
}

public final class Int32Value {
ctor public Int32Value(int);
field public final int value;
}

public enum ListenSource {
enum_constant public static final com.google.firebase.firestore.ListenSource CACHE;
enum_constant public static final com.google.firebase.firestore.ListenSource DEFAULT;
Expand Down Expand Up @@ -360,6 +391,10 @@ package com.google.firebase.firestore {
public interface LocalCacheSettings {
}

public final class MaxKey {
method public static com.google.firebase.firestore.MaxKey instance();
}

public final class MemoryCacheSettings implements com.google.firebase.firestore.LocalCacheSettings {
method public com.google.firebase.firestore.MemoryGarbageCollectorSettings getGarbageCollectorSettings();
method public static com.google.firebase.firestore.MemoryCacheSettings.Builder newBuilder();
Expand Down Expand Up @@ -396,6 +431,10 @@ package com.google.firebase.firestore {
enum_constant public static final com.google.firebase.firestore.MetadataChanges INCLUDE;
}

public final class MinKey {
method public static com.google.firebase.firestore.MinKey instance();
}

public interface OnProgressListener<ProgressT> {
method public void onProgress(ProgressT);
}
Expand Down Expand Up @@ -491,6 +530,12 @@ package com.google.firebase.firestore {
method public <T> java.util.List<T!> toObjects(Class<T!>, com.google.firebase.firestore.DocumentSnapshot.ServerTimestampBehavior);
}

public final class RegexValue {
ctor public RegexValue(String, String);
field public final String! options;
field public final String! pattern;
}

@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME) @java.lang.annotation.Target({java.lang.annotation.ElementType.METHOD, java.lang.annotation.ElementType.FIELD}) public @interface ServerTimestamp {
}

Expand Down
Loading
Loading