I need to create compoundIndex for dynamic mongodb collection.
@Document(collection = "#{@tenant}_transactions")
@CompoundIndexes({
@CompoundIndex(name = "transaction_index", def = "{'a': 1, 'b': 1, 'c': 1}", background = true)
})
But how can I handle the cases where collections are already present.
I can give the scripts but I need to understand if there is any programmatic way to do that