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: throw an Error when creating with an existing docId #414

Merged
merged 4 commits into from
Dec 12, 2023

Conversation

gmaclennan
Copy link
Member

The internal dataType[kCreateWithDocId]() method should not allow you to create two documents with the same docId. This creates a "fork", which can lead to unexpected behaviour. The existing doc should be updated instead with dataType.update().

This PR checks if there is an existing document with the given docId and throws if it exists.

@gmaclennan gmaclennan self-assigned this Dec 12, 2023
@achou11 achou11 merged commit e629cd6 into main Dec 12, 2023
7 checks passed
@achou11 achou11 deleted the fix/create-with-doc-id-existing branch December 12, 2023 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants