Skip to content

Firestore: update with arrayUnion doesn't accept POJO #5622

Description

@abchugh

Writing this POJO works in other APIs but fails in ArrayUnion updates.

Exception thrown

java.lang.reflect.InvocationTargetException: Cannot convert org.wizgraph.backend.data.common.ResourcePointer@7f6c897b to Firestore Value

Environment details

Java version: 8
Firestore maven version:

<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-firestore</artifactId>
<version>1.10.0</version>

Code example

  public static void updateStarredFramework(
      DocumentReference ref, String fieldName, ResourcePointer ptr) throws Exception {
    FieldValue updateValue = FieldValue.arrayUnion(ptr);
    ref.update(fieldName, updateValue).get();
  }

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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