How do I set a 2D index in play morphia?
Example:
db.places.ensureIndex( { loc : "2d" } )
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume you mean play 1.2.x.
You can’t do this from the @Indexed annotation yet, it seems: http://code.google.com/p/morphia/issues/detail?id=290
You can do it with this somewhat hacky [untested] code:
But you might just want to do it from the shell, as you show. It’s a one time thing.