mongodb - How to set a 2D index in Play Morphia? -


how set 2d index in play morphia?

example:

db.places.ensureindex( { loc : "2d" } ) 

http://www.mongodb.org/display/docs/geospatial+indexing

i assume mean play 1.2.x.

you can't @indexed annotation yet, seems: http://code.google.com/p/morphia/issues/detail?id=290

you can hacky [untested] code:

morphiaplugin.ds()    .getmongo()    .getdb('dbname')    .getcollection('places')    .ensureindex(basicdbobject(loc, "2d")); 

but might want shell, show. it's 1 time thing.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -