I want to be able to check if indexes are created while spring context initialization.
So I have a bean that for all of mine
public class MongoIndexInfo { String collectionName; Class collectionClass; IndexDefinition indexDefinition; }
classes doing
IndexOperations indexOps = mongoOperations.indexOps(collectionName); indexOps.ensureIndex(definition);
Default as I understand. But this method isn’t working when my cluster is in read-only mode and I cannot initialize spring context.
Can I somehow check if my mongodb index is already created only by read operations?
I’m newbie in mongo, by the docs and the internet I only read more and more about ensureIndexes and createIndexes. But nothing about what I’m searching for.
Levon Khazhoyan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.