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): add addCollectionGroupSnapshotListener #624

Open
2 of 12 tasks
svrznjak opened this issue May 8, 2024 · 3 comments · May be fixed by #628
Open
2 of 12 tasks

feat(firestore): add addCollectionGroupSnapshotListener #624

svrznjak opened this issue May 8, 2024 · 3 comments · May be fixed by #628

Comments

@svrznjak
Copy link

svrznjak commented May 8, 2024

Plugin(s)

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

Current problem

I am not sure but I think there is a very important feature missing. What I am trying to do is addCollectionSnapshotListener on collectionGroup query.
Such a thing can be done with javascript firebase library like this:
const resources = query(collectionGroup(getFirestore(), 'resources'));
onSnapshot(resources, (querySnapshot) => {
querySnapshot.forEach((doc) => {
console.log(doc.data());
});
});

Preferred solution

Since there already are getCollection, addCollectionSnapshotListener and getCollectionGroup functions in API, I would suggest addCollectionGroupSnapshotListener function is added.

I made a quick glance at addCollectionSnapshotListener web code and I think whole function can be copied and only change that is needed is on line 212 where 'collecion' should be changed to 'collectionGroup'.

Alternative options

No response

Additional context

No response

Before submitting

@robingenz robingenz changed the title feat: feat(firestore): add addCollectionGroupSnapshotListener May 8, 2024
@robingenz
Copy link
Member

Thank you for your request. Would you be willing to create a PR?

@svrznjak
Copy link
Author

Time files... Well, I am not familiar with capacitor plugins, but I can give it a try.

@robingenz
Copy link
Member

Let me know if you have any questions. I am currently working on other issues, so it will take some time until I get to this issue. You can also sponsor the issue if you want me to prioritize it.

@svrznjak svrznjak linked a pull request May 21, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants