-
Notifications
You must be signed in to change notification settings - Fork 204
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
Trigger support for withConverter #872
Comments
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight. |
Great idea! I don't have a timeline for this, but I'll keep it in mind for our roadmap. |
Second this! I ended up here wondering if this was already a thing. We have some model classes whose methods are called immediately inside an onUpdate. It would save a few lines in every trigger to be able to have those models converted on the way out of Firestore like we do in our database classes. Thanks for all the great work, my team and I love using Firebase 🙂 |
Work around at this moment. async (snap, context) => {
const _ref = snap.ref.withConverter(Model.converter)
const _snap = await _ref.get()
const model = _snap.data()
} |
That would cause an additional read, I'm afraid. |
I'll admit I'm not used to using converters. It seems like a reasonable workaround would be
But a converter expects a |
QueryDocumentSnapshots are just DoumentSnapshots for documents that are known to exists. Code like |
Anything I can do to help get this moved along? This would be a great feature. |
Not sure if you accept Feature Requests, but I'll make it brief:
Would be nice if the
onCreate
,onWrite
,onUpdate
andonDelete
triggers had support forwithConverter
:Example:
Thanks
ref: googleapis/nodejs-firestore#1449
The text was updated successfully, but these errors were encountered: