Package org.springframework.data.mongodb.core

Examples of org.springframework.data.mongodb.core.IndexOperations


   * @see DATAMONGO-360
   */
  @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));
View Full Code Here


    try {

      GeoSpatialEntity2dWithGeneratedIndex geo = new GeoSpatialEntity2dWithGeneratedIndex(45.2, 4.6);
      template.save(geo);

      IndexOperations indexOps = template.indexOps(GeoSpatialEntity2dWithGeneratedIndex.class);
      List<IndexInfo> indexInfo = indexOps.getIndexInfo();

      assertThat(indexInfo, hasSize(2));
      assertThat(indexInfo.get(1), is(notNullValue()));
      assertThat(indexInfo.get(1).getName(), is("location_2d"));
View Full Code Here

  private @Autowired MongoOperations template;

  @Before
  public void setUp() {

    IndexOperations indexOps = template.indexOps(FullTextDoc.class);
    indexOps.dropAllIndexes();

    indexOps.ensureIndex(new IndexDefinition() {

      @Override
      public DBObject getIndexOptions() {
        DBObject options = new BasicDBObject();
        options.put("weights", weights());
View Full Code Here

TOP

Related Classes of org.springframework.data.mongodb.core.IndexOperations

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.