Skip to content
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

feat(firestore): support all FieldValue #443

Open
1 of 9 tasks
ocavue opened this issue Sep 28, 2023 · 5 comments
Open
1 of 9 tasks

feat(firestore): support all FieldValue #443

ocavue opened this issue Sep 28, 2023 · 5 comments

Comments

@ocavue
Copy link

ocavue commented Sep 28, 2023

Plugin(s)

  • Analytics
  • App
  • App Check
  • Authentication
  • Crashlytics
  • Cloud Firestore
  • Cloud Messaging
  • Performance
  • Remote Config

Current problem

The current @capacitor-firebase/firestore@5.1.0-dev.b89276d.1695905786 doesn't support FieldValue.serverTimestamp, FieldValue.arrayUnion etc yet.

Preferred solution

Add support for all FieldValue

Alternative options

No response

Additional context

No response

@robingenz
Copy link
Member

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.

@robingenz robingenz changed the title feat(firestore): support all FieldValue feat(firestore): support all FieldValue Sep 29, 2023
@robingenz robingenz modified the milestones: v5.3.0, v5.2.0 Oct 10, 2023
@robingenz robingenz mentioned this issue Oct 15, 2023
14 tasks
@robingenz robingenz mentioned this issue Oct 24, 2023
@orestis-z
Copy link

Here a working example for Android + FieldValue.increment: main...orestis-z:capacitor-firebase:main#diff-047d76fdd82cc667e41c3f3ec57900e9dd1448ab35a5714c8bcd9bc8282e7427

@Cosmicist
Copy link

Cosmicist commented Apr 17, 2024

Is there any update on this issue? I saw a now closed PR with a solution that looks promising #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!

@robingenz
Copy link
Member

@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.

@Cosmicist
Copy link

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.

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

No branches or pull requests

4 participants