-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DATAMONGO-2188 - Deprecate auto-index creation. #636
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Auto-index creation can now be disabled by setting MongoMappingContext.setAutoIndexCreation(false). This configuration prevents automatic index creation on application startup and during access to entities. Auto-index creation comes with automated collection creation. Users that rely on collection creation (e.g. if you wish to use ClientSessions or transactions) must make sure the collection exists prior to session usage.
We now provide IndexResolver to resolve and derive index definitions from Mongo entities. MongoMappingContext mappingContext = new MongoMappingContext(); IndexResolver indexResolver = IndexResolver.create(mappingContext); Iterable<? extends IndexDefinitionHolder> definitions = indexResolver.resolveIndexFor(MyEntity.class);
christophstrobl
force-pushed
the
issue/DATAMONGO-2188
branch
2 times, most recently
from
January 22, 2019 11:02
789642e
to
46cda36
Compare
Undo deprecation and transition to configuration option allowing to disable the index creation. Index creation will remain in the codebase as it is used in a lot of places to configure required geo index structures in MongoDB without which query execution would fail.
christophstrobl
force-pushed
the
issue/DATAMONGO-2188
branch
from
January 22, 2019 12:06
46cda36
to
f4d5d5f
Compare
christophstrobl
pushed a commit
that referenced
this pull request
Jan 23, 2019
…ion to disable it. Auto-index creation can now be disabled by setting MongoMappingContext.setAutoIndexCreation(false). This configuration prevents automatic index creation on application startup and during access to entities. Original Pull Request: #636
christophstrobl
pushed a commit
that referenced
this pull request
Jan 23, 2019
We now provide IndexResolver to resolve and derive index definitions from Mongo entities. MongoMappingContext mappingContext = new MongoMappingContext(); IndexResolver indexResolver = IndexResolver.create(mappingContext); Iterable<? extends IndexDefinitionHolder> definitions = indexResolver.resolveIndexFor(MyEntity.class); Original Pull Request: #636
christophstrobl
added a commit
that referenced
this pull request
Jan 23, 2019
Undo deprecation and transition to configuration option allowing to disable the index creation. Index creation will remain in the codebase as it is used in a lot of places to configure required geo index structures in MongoDB without which query execution would fail. Original Pull Request: #636
This was referenced Dec 30, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We now deprecate the auto-index creation feature as automatic index creation has created a lot of downstream issues.
We also introduce a configuration flag to disable auto-index creation through MongoMappingContext.setAutoIndexCreation(false).
Lastly, we're exposing
IndexResolver
to allow application code to derive index definitions from annotated entities.Related ticket: DATAMONGO-2188.