Open sjapps opened 4 years ago
Here is how flutterfire implements it:
Those methods then call _CodecUtility. It looks like its using "FieldValueFactoryPlatform
" which are platform specific so this may not be possible with rest api.
I don't think this is currently possible (I'd have to test to be sure though).
It seems like some sort of advanced features that I don't expect most people to need. I wouldn't be against someone submitting a pull request for it but honestly if you need to do a lot of work with individual items in a list, you'd probably be better off just implementing it as a collection rather than an array inside a document.
Hi I am facing the same problem is there anyone that could help me ????
Firestore.instance .collection('YourCollection') .document('YourDocument') .updateData({'array':FieldValue.arrayUnion(['data1','data2','data3'])});
How to do this with firedart?????
The arrayUnion
operator in the Firebase SDKs maps to appendMissingElements
. in the Firestore REST API. See https://firebase.google.com/docs/firestore/reference/rest/v1beta1/Write for more into.
Flutter firestore has something like this to add items to arrays
Is this possible with this library yet?
The nodejs library also has the following (https://googleapis.dev/nodejs/firestore/latest/FieldValue.html)