Share via


DocumentClient.DeleteDocumentCollectionAsync Methode

Definition

Überlädt

DeleteDocumentCollectionAsync(String, RequestOptions)

Löschen Sie einen DocumentCollection aus dem Azure Cosmos DB-Dienst als asynchronen Vorgang.

DeleteDocumentCollectionAsync(Uri, RequestOptions)

Löschen Sie eine Sammlung als asynchronen Vorgang aus dem Azure Cosmos DB-Dienst.

DeleteDocumentCollectionAsync(String, RequestOptions)

Löschen Sie einen DocumentCollection aus dem Azure Cosmos DB-Dienst als asynchronen Vorgang.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.DocumentCollection>> DeleteDocumentCollectionAsync (string documentCollectionLink, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeleteDocumentCollectionAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.DocumentCollection>>
override this.DeleteDocumentCollectionAsync : string * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.DocumentCollection>>
Public Function DeleteDocumentCollectionAsync (documentCollectionLink As String, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of DocumentCollection))

Parameter

documentCollectionLink
String

Der Link des Document zu löschenden. Beispiel: dbs/db_rid/colls/col_rid/

options
RequestOptions

(Optional) Die Anforderungsoptionen für die Anforderung.

Gibt zurück

Eine System.Threading.Tasks , die eine ResourceResponse<TResource> enthält, die Informationen über die ausgestellte Anforderung enthält.

Implementiert

Ausnahmen

Wenn documentCollectionLink nicht festgelegt ist.

Diese Ausnahme kann viele verschiedene Fehlertypen kapseln. Um den spezifischen Fehler zu ermitteln, sehen Sie sich immer die StatusCode-Eigenschaft an. Einige häufige Codes, die Sie beim Erstellen eines Dokuments erhalten, sind:

StatusCodeAusnahmegrund
404NotFound– Dies bedeutet, dass die Ressource, die Sie löschen möchten, nicht vorhanden war.

Beispiele

//Delete a collection using its selfLink property
//To get the collectionLink you would have to query for the Collection, using CreateDocumentCollectionQuery(),  and then refer to its .SelfLink property
await client.DeleteDocumentCollectionAsync(collectionLink);

Weitere Informationen

Gilt für:

DeleteDocumentCollectionAsync(Uri, RequestOptions)

Löschen Sie eine Sammlung als asynchronen Vorgang aus dem Azure Cosmos DB-Dienst.

public System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.DocumentCollection>> DeleteDocumentCollectionAsync (Uri documentCollectionUri, Microsoft.Azure.Documents.Client.RequestOptions options = default);
abstract member DeleteDocumentCollectionAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.DocumentCollection>>
override this.DeleteDocumentCollectionAsync : Uri * Microsoft.Azure.Documents.Client.RequestOptions -> System.Threading.Tasks.Task<Microsoft.Azure.Documents.Client.ResourceResponse<Microsoft.Azure.Documents.DocumentCollection>>
Public Function DeleteDocumentCollectionAsync (documentCollectionUri As Uri, Optional options As RequestOptions = Nothing) As Task(Of ResourceResponse(Of DocumentCollection))

Parameter

documentCollectionUri
Uri

der URI der zu löschenden Dokumentauflistung.

options
RequestOptions

Die Anforderungsoptionen für die Anforderung.

Gibt zurück

Das Taskobjekt, das die Dienstantwort für den asynchronen Vorgang darstellt.

Implementiert

Gilt für: