Replies: 1 comment 1 reply
-
That's the (mostly) correct way to do that. In 3.0, the application of indexes will be done transparently and will be controlled via either the configuration file or or |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am struggling with a funny phenomenon in regard to creating indexes based on Annotation @indexes.
Only if I add the following two statements before an insert (save), the Indexes will be created in MongoDb as expected.
The funny thing is, it realy needs both of the statements in combination.
My Index Annotation:
I am using MongoDb Server 7.0
My pom dependencies:
I was spending quite a time in different forums. Since ensureIndexes is deprecated I found alot of forums dealing with older versions of morphia. Neither in the official documentation nor in other sources I found a hint helping me with my issue.
It just says: no longer use ensureIndexes, use createIndex. Ok, but as far as I understood, then I have to define my Indexes hardcoded instead of the Annotation way. I realy like to use the Annotations. This is one of the reasons why I decided to use Morphia.
Does any one have a hint for me?
Beta Was this translation helpful? Give feedback.
All reactions