Skip to content

Allow Collection.add() to use custom objects #2607

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

Merged
merged 5 commits into from
Feb 10, 2020
Merged

Allow Collection.add() to use custom objects #2607

merged 5 commits into from
Feb 10, 2020

Conversation

thebrianchen
Copy link

Fixes #2606

One downside to this approach is if the underlying DocumentReference.set() fails, the function name in the error message will not say CollectionReference.add() (see applyFirestoreDataConverter). I thought about how to refactor set() to allow the function name to be passed down, but ultimately decided that this approach is cleaner + the developer can see the stack trace and deduce that for themselves.

Copy link
Contributor

@wilhuff wilhuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wilhuff wilhuff assigned thebrianchen and unassigned wilhuff Feb 10, 2020
@thebrianchen thebrianchen merged commit eb614f0 into master Feb 10, 2020
@thebrianchen thebrianchen deleted the bc/add branch February 10, 2020 22:42
@firebase firebase locked and limited conversation to collaborators Mar 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error "CollectionReference.add() requires its first argument to be of type object" when used with withConverter
2 participants