Closed timja closed 5 years ago
Hi Tim, Thanks for reaching out , These is a Helper.java in example project of the code doing the same thing which you can refer ,
https://github.com/Azure/azure-cosmosdb-java/blob/master/examples/src/main/java/com/microsoft/azure/cosmosdb/rx/examples/multimaster/Helpers.java createDatabaseIfNotExists createCollectionIfNotExists
Thanks looks perfect, any reason its not in the core code? looks useful
Hi Tim, Thanks for reaching out , These is a Helper.java in example project of the code doing the same thing which you can refer ,
https://github.com/Azure/azure-cosmosdb-java/blob/master/examples/src/main/java/com/microsoft/azure/cosmosdb/rx/examples/multimaster/Helpers.java createDatabaseIfNotExists createCollectionIfNotExists
Thanks looks perfect, any reason its not in the core code? looks useful
Glad it helped !! Yes we are planning to include within the SDK in future release.
Hi
Is it possible to create a resource only if it doesn't exist? i.e. a database or a collection,
currently it seems a bit clunky
I had a look at what the tests do to get around this, and they do a delete and create which isn't feasible for production usage.
I'm currently checking if they exist and then creating if needed. But the code I have isn't the nicest
as I want to do a: