I have written an application that uses Spring MongoRepository to connect to a collection of Product Sales, which contains sales data for all products.
NOw, I am facing a problem, since instead of one single collection, I have now several collections of Product Sales, each containing one single product. All collections structure is still the same, but now each collection name is something like 'Sales_123', 'Sales_456', where the numeric suffix is the product Id.
It means I can no longer use the Document annotation to specify the collection name. Can I still do something to pass the collection name at runtime to MongoRepository?
Perhaps, is there any feasible way to plug a modified MappingMongoEntityInformation to which I could pass some way the collection name?
Or is it better to just re-write the whole thing using mongoTemplate?