capacitor-firebase
capacitor-firebase copied to clipboard
feat(firestore): support all `FieldValue`
Plugin(s)
- [ ] Analytics
- [ ] App
- [ ] App Check
- [ ] Authentication
- [ ] Crashlytics
- [X] Cloud Firestore
- [ ] Cloud Messaging
- [ ] Performance
- [ ] Remote Config
Current problem
The current @capacitor-firebase/[email protected] doesn't support FieldValue.serverTimestamp, FieldValue.arrayUnion etc yet.
Preferred solution
Add support for all FieldValue
Alternative options
No response
Additional context
No response
Thank you, this is indeed missing. I will have to check how we can implement this feature, since with Capacitor you can only pass plain JSON over the bridge.
Here a working example for Android + FieldValue.increment: https://github.com/capawesome-team/capacitor-firebase/compare/main...orestis-z:capacitor-firebase:main#diff-047d76fdd82cc667e41c3f3ec57900e9dd1448ab35a5714c8bcd9bc8282e7427
Is there any update on this issue? I saw a now closed PR with a solution that looks promising https://github.com/capawesome-team/capacitor-firebase/pull/475 and wonder if something like this will be implemented at some point since it is an important missing feature.
In the meantime, is there some kind of js-side workaround that we could be using? (I mean while still using the native sdk) . Sorry if this is an obvious question, but I couldn't find a way yet.
Thanks!
@Cosmicist No, there are currently no updates. I will use the approach from #475 to fix this issue. Unfortunately, I can't give an ETA yet because this issue is quite complex.
In the meantime, is there some kind of js-side workaround that we could be using?
No, unfortunately not. There are workarounds for some field values. For example, you could replace FieldValue.serverTimestamp with a Firebase Cloud Function that updates the document as soon as it's created or updated.
Hey @robingenz! Thanks for the input, I really appreciate it.
I like the cloud function idea, I'll probably try it for writes. For querying though I'll probably need to resort to the web sdk for the time being.