2

Currently, I have an empty array in Firestore dashboard. And I'm trying to add some item to it. I've followed this, but no result. I don't want to sore and rewrite this element.

My gradle contains:

implementation 'com.google.firebase:firebase-firestore:17.0.4'

and my code:

import com.google.firebase.firestore.FieldValue

...

val documentReference = firestore.collection("events")
                .document(event.firebaseUserUid + "-" + event.title)
    documentReference
                .update("participants", (FieldValue.arrayUnion(FirebaseAuth.getInstance().currentUser!!.uid)) )

But FieldValue.arrayUnion doesn't exists.

2 Answers 2

1

I don't think support for that has actually been added to the Android API, despite its documentation as such on the page you linked.

It's missing from the Android API documentation, but is present in the Web API documentation as well as the Web changelog.

Sign up to request clarification or add additional context in comments.

Comments

0

Newest version of firestore now supports it:

 implementation 'com.google.firebase:firebase-firestore:17.1.0'

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.