Skip to content

Commit 2cc393a

Browse files
committed
docs: remove delete partition segment from preview section
1 parent d68ae9b commit 2cc393a

File tree

2 files changed

+4
-34
lines changed

2 files changed

+4
-34
lines changed

README.md

-34
Original file line numberDiff line numberDiff line change
@@ -249,40 +249,6 @@ az cosmosdb update --resource-group $ResourceGroup --name $AccountName --enable
249249

250250
See [MS Learn](https://learn.microsoft.com/en-us/azure/cosmos-db/priority-based-execution) for more details.
251251
252-
### Delete resources by partition key
253-
254-
The preview version of the library extends the `ICosmosWriter` and `ILowPriorityCosmosWriter` with and additional method `DeletePartitionAsync` to delete all resources in a container based on a partition key. The deletion will be executed in a CosmosDB background service using a percentage of the RU's available. The effect are available immediatly as all resources in the partition will not be available through reads or queries.
255-
256-
In order to use this new method the "Delete All Items By Partition Key" feature needs to be enabled on the CosmosDB account.
257-
258-
This can be done through Azure CLI:
259-
260-
```bash
261-
# Delete All Items By Partition Key
262-
az cosmosdb update --resource-group $ResourceGroup --name $AccountName --capabilities DeleteAllItemsByPartitionKey
263-
```
264-
265-
or wih bicep:
266-
267-
```bicep
268-
resource cosmosAccount 'Microsoft.DocumentDB/databaseAccounts@2024-05-15' = {
269-
name: cosmosName
270-
properties: {
271-
databaseAccountOfferType: 'Standard'
272-
locations: location
273-
capabilities: [
274-
{
275-
name: 'DeleteAllItemsByPartitionKey'
276-
}
277-
]
278-
}
279-
}
280-
```
281-
282-
If the feature is not enabled when calling this method then a `CosmosException` will be thrown.
283-
284-
See [MS Learn](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/how-to-delete-by-partition-key) for more details.
285-
286252
## Unit Testing
287253
The reader and writer interfaces can easily be mocked, but in some cases it is nice to have a fake version of a reader or writer to mimic the behavior of the read and write operations. For this purpose the `Atc.Cosmos.Testing` namespace contains the following fakes:
288254

test/Atc.Cosmos.Tests/CosmosWriterTests.cs

+4
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,11 @@ public async Task DeletePartitionAsync_Calls_DeleteAllItemsByPartitionKeyStreamA
306306
.Received(1)
307307
.DeleteAllItemsByPartitionKeyStreamAsync(
308308
new PartitionKey(record.Pk),
309+
#if PREVIEW
309310
Arg.Is<ItemRequestOptions>(o => o.PriorityLevel == PriorityLevel.High),
311+
#else
312+
Arg.Any<ItemRequestOptions>(),
313+
#endif
310314
cancellationToken: cancellationToken);
311315
}
312316

0 commit comments

Comments
 (0)