List of usage examples for org.springframework.data.mongodb.core.index IndexField geo
public static IndexField geo(String key)
From source file:org.springframework.data.mongodb.core.geo.GeoSpatialTests.java
/** * @see DATAMONGO-360/*from www.ja v a 2 s .com*/ */ @Test public void indexInfoIsCorrect() { IndexOperations operations = template.indexOps(Venue.class); List<IndexInfo> indexInfo = operations.getIndexInfo(); assertThat(indexInfo.size(), is(2)); List<IndexField> fields = indexInfo.get(0).getIndexFields(); assertThat(fields.size(), is(1)); assertThat(fields, hasItem(IndexField.create("_id", Direction.ASC))); fields = indexInfo.get(1).getIndexFields(); assertThat(fields.size(), is(1)); assertThat(fields, hasItem(IndexField.geo("location"))); }