Closed cocowalla closed 5 years ago
Hello @cocowalla,
These are different environments or configurations under which your project runs right?
You can do that manually by using the overrideCollectionName
at the CosmosStore
instantiation method or the DI registration ones and providing your own prefix logic using your configuration.
However this is a really valid point and I would like to implement this feature as it would be easy to just do it at the CosmosStoreSettings
level as you said.
Thanks for submitting this, I will leave it open until I implement the feature.
Hello @cocowalla,
Feature added in develop
. Will be added in the next minor release.
Thanks for making Cosmonaut better.
Looks good, thanks! 👏
A pattern I've used with Azure's SQL Server and Postgres PaaS offerings is to use a single instance to hold data for all our test environments (e.g. dev, test, qa), by using database schemas. For example, if I had a
Widgets
table, it would exist in all of the schemas:This reduces costs, as there is only 1 database instance instead of 3, and also means there are less Azure resources to manage.
I'd like to do the same with Cosmos DB, but AFAIK it doesn't have a schema/namespace concept, so the idea would be to prefix the name of each collection with the environment, e.g.:
What I'm looking for is perhaps a
CollectionPrefix
property onCosmosStoreSettings
.Is there any way to achieve this at present? If not, are you open to discussing a mechanism for this?