Affects: 2.3.0.M4
The issue I'm facing is related to Index creation, both with annotation and code.
I've tried to use @Index and also @CompoundIndexes in my @Document class. Neither of those created the expected indexs, either with unique false or true.
After that, I've tried to create the index myself using:
Document doc = new Document();
doc.put("example", 1);
doc.put("example2", 1);
CompoundIndexDefinition index = new CompoundIndexDefinition(doc);
mongoOps
.indexOps(ExampleDoc.class)
.ensureIndex(index);
The result was the same, no index created other then id:
[
2,
{
"_id" : 1
},
"_id_",
"test.exampleDoc"
]
I've created the project using initializer, some relevant dependencies:
spring-aop-5.2.5.RELEASE.jar
spring-boot-data-mongodb-3.0.0.RC1 mongodb-driver-reactivestreams-4.0.1.jar mongodb-driver-core-4.0.1.jar Why do we need both?!
Comment From: snicoll
I am not sure I understand what exactly you are reporting and why you are reporting that in the core Spring Framework issue tracker.
If you have a usage problem with MongoDB, please ask on StackOverflow, as mentioned in the guidelines for contributing, we prefer to use the issue tracker only for bugs and enhancements.
If you believe you've found a bug in Spring Data MongoDB, please create an issue there and share a small sample that demonstrates the bug (the application you've created from start.spring.io).