-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[cloud_firestore] Can't add to list with transaction. Please Help. #23
Comments
Temporary workaround was to make the placeholder a map instead and in the transaction add the map to the existing map (placeholder).
|
I'm confused by your original code snippet, since it looks like you're using the return value of |
try this: |
@mikeyyg96 did it work for you? |
Hi @mikeyyg96 |
I tried many different ways but I cannot add to a placeholder list that I have. I followed exactly how the documentation handled it, too.
await Firestore.instance.collection('users').document(user.uid).setData({ 'ban_list': [], });
await tx.update(postRef, <String, dynamic>{ 'ban_list': postSnapshot.data['ban_list'] .add(listOfDocs[index]['id']) });
The text was updated successfully, but these errors were encountered: