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

Add to database only if unique #53

Open
Turnerj opened this issue Mar 28, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@Turnerj
Copy link
Member

commented Mar 28, 2019

Add a helper function that you can easily add new entities to the DB only if the entities do not already exist based on a specified column. This would need to perform a read before it could perform the write to ensure it doesn't exist.

This being said, the functionality could probably work out-of-the-box with Unique Indexes - just depends how it handles failed writes in bulk or not. If it throws an exception, that would be a problem. https://docs.mongodb.com/manual/core/index-unique/

Further investigation required before adding this feature.

@Turnerj Turnerj added the enhancement label Mar 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.