Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Firestore should accept Protobuf and Firestore Value(s) #3315

@sgammon

Description

@sgammon

Currently, the Firestore SDK provides the following interfaces for set(/update(/etc, w.r.t. write batches and writing in general (parameters irrelevant to this ticket omitted):

  • Add via Java: set(..., Map<String, Object> fields, ...)
  • Add via POJO: set(..., Object pojo, ...)

These are great for a lot of use cases. But, those underlying methods immediately serialize everything to com.google.firestore.v1beta1.Value objects.

If your application would like more control over the Value(s) selected during serialization, why can't you provide your object via set(..., Map<String, com.google.firestore.v1beta1.Value>)?

I'd like to request that such an interface be added. Or, another way to do it would be to accept Protobuf's regular Value well-known-type. However, it seems as though it reflects a subset of Firestore's types (i.e. setNumberValue where Firestore has setDoubleValue, setIntegerValue, etc) so I understand why that particular type wrapper was not used.

Thank you in advance

Metadata

Metadata

Assignees

Labels

api: firestoreIssues related to the Firestore API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions