Skip to content

Fix #556 Adding sparce & unique indices #835

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 2 commits into from
Sep 1, 2016

Conversation

benargo
Copy link
Contributor

@benargo benargo commented May 11, 2016

Provides a handy shortcut for allowing both sparse and unique indices on columns. MongoDB provides a method of only checking unique values where the field is not null (or 'sparse'). At present, using the unique and sparse functions separately throws an MongoDuplicateKeyException (see issue #556).

You can get around this by using the index function, but my understanding is this should be avoided (please correct me if I'm wrong).

benargo added 2 commits May 11, 2016 12:50
Provides a handy workaround for issue 556.
This addresses the issues highlighted in the StyleCI analysis.
@benargo benargo changed the title Adding sparce & unique indices Fix #556: Adding sparce & unique indices May 25, 2016
@benargo benargo changed the title Fix #556: Adding sparce & unique indices Fix #556 Adding sparce & unique indices May 25, 2016
@pi0
Copy link
Contributor

pi0 commented Sep 1, 2016

@jenssegers why not merging this ?

@jenssegers jenssegers merged commit 3aad3bd into mongodb:master Sep 1, 2016
pi0 pushed a commit to pi0/laravel-mongodb that referenced this pull request Sep 1, 2016
jenssegers pushed a commit that referenced this pull request Sep 1, 2016
@benargo benargo deleted the unique_and_sparce branch October 9, 2017 12:22
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
* Adding sparce & unique indices

Provides a handy workaround for issue 556.

* Code styling fix

This addresses the issues highlighted in the StyleCI analysis.
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
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.

3 participants