Comments (4)
It turns out that it is possible to obtain the information of whether the database was created from the status property on the response object, but the API seems to be quite complex.
from azure-cosmos-dotnet-v3.
Hi Deigo,
All of the Async method with throw an exception if it get's an error while creating the container. The exception to this rule is Cosmos Item Stream APIs which only return the status. This is for performance reasons. Also to note that not found is not an exception. This is considered as part of a normal workflow, and will return null for the resource.
The responses are documented here.
from azure-cosmos-dotnet-v3.
@j82w the issue was about being able to more easily distinguish between two different conditions when a call to CreateContainerIfNotExistsAsync succeeds:
- The container already exists and didn’t need to be created
- The container did not exist and was successfully created
I will let @AndriySvyryd comment if he still thinks there is an API usability or discoverability problem worth addressing.
from azure-cosmos-dotnet-v3.
@divega if that is the case you can do the read yourself, and if it is null do the create.
from azure-cosmos-dotnet-v3.
Related Issues (20)
- Missing NuGet package 3.39.0 HOT 5
- Convert Legacy Pipelines to One Branch V2
- ChangeFeedProcessorBuilder throws exception for ChangeFeedMode on 3.39.0 HOT 2
- Illegal instruction HOT 5
- ToString(signed-integer) is broken (32-64 bit conversion) HOT 5
- Migration path from sdk version < 3.38 to 3.38.1 HOT 2
- Single Partition Queries that resume using continuation token after partition split can observe failure on SDK v3.38 and beyond HOT 1
- Performance: MockedItemBenchmark.ReadItemExists;[Type=Stream] takes longer to run as expect in Preview mode.
- [Cosmos .NET SDK] - Aspire Integration with Cosmos .NET V3 SDK
- Quorum Reader - Include Primary to Meet Quorum when One Secondary Replica is Non-Responsive
- Add option to ItemRequestOptions that returns the state of the document before update/patch HOT 7
- The SDK can't auto detect the consistency level change during runtime HOT 6
- TimeOnly incorrect serialization for 0 time HOT 3
- UpsertItemAsync with ItemOptions.IfMatchEtag not work sometimes HOT 3
- Support for "All versions and delete mode" with Change Feed Processor HOT 1
- Should CosmosLinqQuery.ToString() return a relative or absolute URI for a null/empty query?
- CosmosException: Object contains header information from request and response HOT 1
- Updating Cosmo db from 3.29 to 3.31.2+ causes Kestrel issues HOT 9
- Hedging With Writes on MultiMaster
- [FEATURE REQ] Resolve Native AOT Warnings in Microsoft.Azure.Cosmos
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from azure-cosmos-dotnet-v3.