use of org.springframework.data.mongodb.core.index.IndexInfo in project spring-data-mongodb by spring-projects.
the class DefaultIndexOperationsIntegrationTests method getIndexInfoShouldBeAbleToRead2dsphereIndex.
// DATAMONGO-1008
@Test
public void getIndexInfoShouldBeAbleToRead2dsphereIndex() {
collection.createIndex(GEO_SPHERE_2D);
IndexInfo info = findAndReturnIndexInfo(GEO_SPHERE_2D);
assertThat(info.getIndexFields().get(0).isGeo()).isEqualTo(true);
}
use of org.springframework.data.mongodb.core.index.IndexInfo in project spring-data-mongodb by spring-projects.
the class DefaultIndexOperationsIntegrationTests method shouldApplyPartialFilterWithMappedPropertyCorrectly.
// DATAMONGO-1467
@Test
public void shouldApplyPartialFilterWithMappedPropertyCorrectly() {
assumeThat(mongoVersion.isGreaterThanOrEqualTo(THREE_DOT_TWO), is(true));
IndexDefinition id = new Index().named("partial-with-mapped-criteria").on("k3y", Direction.ASC).partial(of(where("quantity").gte(10)));
indexOps.ensureIndex(id);
IndexInfo info = findAndReturnIndexInfo(indexOps.getIndexInfo(), "partial-with-mapped-criteria");
assertThat(info.getPartialFilterExpression()).isEqualTo("{ \"qty\" : { \"$gte\" : 10 } }");
}
use of org.springframework.data.mongodb.core.index.IndexInfo in project spring-data-mongodb by spring-projects.
the class DefaultIndexOperationsIntegrationTests method shouldApplyPartialFilterCorrectly.
// DATAMONGO-1467
@Test
public void shouldApplyPartialFilterCorrectly() {
assumeThat(mongoVersion.isGreaterThanOrEqualTo(THREE_DOT_TWO), is(true));
IndexDefinition id = new Index().named("partial-with-criteria").on("k3y", Direction.ASC).partial(of(where("q-t-y").gte(10)));
indexOps.ensureIndex(id);
IndexInfo info = findAndReturnIndexInfo(indexOps.getIndexInfo(), "partial-with-criteria");
assertThat(info.getPartialFilterExpression()).isEqualTo("{ \"q-t-y\" : { \"$gte\" : 10 } }");
}
use of org.springframework.data.mongodb.core.index.IndexInfo in project spring-data-mongodb by spring-projects.
the class DefaultReactiveIndexOperationsTests method shouldApplyPartialFilterCorrectly.
// DATAMONGO-1682
@Test
public void shouldApplyPartialFilterCorrectly() {
assumeTrue(mongoVersion.isGreaterThanOrEqualTo(THREE_DOT_TWO));
IndexDefinition id = new Index().named("partial-with-criteria").on("k3y", Direction.ASC).partial(of(where("q-t-y").gte(10)));
StepVerifier.create(indexOps.ensureIndex(id)).expectNextCount(1).verifyComplete();
//
StepVerifier.create(indexOps.getIndexInfo().filter(this.indexByName("partial-with-criteria"))).consumeNextWith(indexInfo -> {
assertThat(indexInfo.getPartialFilterExpression()).isEqualTo("{ \"q-t-y\" : { \"$gte\" : 10 } }");
}).verifyComplete();
}
use of org.springframework.data.mongodb.core.index.IndexInfo in project spring-data-mongodb by spring-projects.
the class DefaultReactiveIndexOperationsTests method shouldApplyPartialFilterWithMappedPropertyCorrectly.
// DATAMONGO-1682
@Test
public void shouldApplyPartialFilterWithMappedPropertyCorrectly() {
assumeTrue(mongoVersion.isGreaterThanOrEqualTo(THREE_DOT_TWO));
IndexDefinition id = new Index().named("partial-with-mapped-criteria").on("k3y", Direction.ASC).partial(of(where("quantity").gte(10)));
StepVerifier.create(indexOps.ensureIndex(id)).expectNextCount(1).verifyComplete();
//
StepVerifier.create(indexOps.getIndexInfo().filter(this.indexByName("partial-with-mapped-criteria"))).consumeNextWith(indexInfo -> {
assertThat(indexInfo.getPartialFilterExpression()).isEqualTo("{ \"qty\" : { \"$gte\" : 10 } }");
}).verifyComplete();
}
Aggregations