mongodb - How to set a 2D index in Play Morphia? -
how set 2d index in play morphia?
example:
db.places.ensureindex( { loc : "2d" } )
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
Post a Comment