Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ class MyListener{
MappingContext<? extends MongoPersistentEntity<?>, MongoPersistentProperty> mappingContext = mongoTemplate
.getConverter().getMappingContext();

IndexResolver resolver = new MongoPersistentEntityIndexResolver(mappingContext);

// consider only entities that are annotated with @Document
mappingContext.getPersistentEntities()
.stream()
Expand Down Expand Up @@ -123,8 +125,10 @@ public class Person {
[source,java]
----
@Document
@CompoundIndex(name = "cmp-idx-one", def = "{'firstname': 1, 'lastname': -1}")
@CompoundIndex(name = "cmp-idx-two", def = "{'address.city': -1, 'address.street': 1}")
@CompoundIndexes({
@CompoundIndex(name = "cmp-idx-one", def = "{'firstname': 1, 'lastname': -1}"),
@CompoundIndex(name = "cmp-idx-two", def = "{'address.city': -1, 'address.street': 1}")
})
public class Person {

String firstname;
Expand Down