Reputation: 361
My application works fine. I used this official reference to learn morphia:
http://mongodb.github.io/morphia/1.2/getting-started/quick-tour/
In Employee class :
@Indexes(
@Index(value = "salary", fields = @Field("salary"))
)
It says value is Deprecated use fields(). How can I write Index annotation to get rid of deprecated use ?
Upvotes: 0
Views: 739
Reputation: 400
You can just drop the value attribute. The information is already given by fields attribute :
@Indexes(@Index(fields = @Field("salary")))
This should work
For further information, take a look at : https://github.com/mongodb/morphia/wiki/AllAnnotations
Upvotes: 1