문서 삭제

Azure Cosmos DB는 여러 API를 지원하는 전역으로 분산된 다중 모델 데이터베이스입니다. 이 문서에서는 Azure Cosmos DB용 SQL API에 대해 설명합니다.

작업은 Delete Document 컬렉션의 기존 문서를 삭제합니다.

요청

메서드 요청 URI 설명
DELETE https://{databaseaccount}.documents.azure.com/dbs/{db-id}/colls/{coll-id}/docs/{doc-id} {databaseaccount}는 구독에서 만든 Azure Cosmos DB 계정의 이름입니다.

헤더

모든 Cosmos DB 요청에 사용되는 헤더는 일반적인 Azure Cosmos DB REST 요청 헤더를 참조하세요.

헤더 필수 형식 설명
x-ms-documentdb-partitionkey 선택 Array 삭제할 문서의 파티션 키 값입니다. partitionKey 정의를 사용하여 컬렉션을 만든 경우에만 포함해야 합니다.

본문

없음

응답

서비스에서 빈 응답 본문을 반환합니다.

헤더

모든 Cosmos DB 응답 에서 반환되는 헤더는 일반적인 Azure Cosmos DB REST 응답 헤더를 참조하세요. 문서 삭제에 대한 중요한 응답 헤더는 다음과 같습니다.

속성 형식 Description
x-ms-request-charge 번호 작업에서 사용하는 요청 단위 수입니다.
x-ms-session-token 문자열 세션 수준 일관성에 사용되는 문자열 토큰입니다. 클라이언트는 이 값을 저장하고 세션 일관성에 대한 후속 읽기 요청에 대해 설정해야 합니다.

상태 코드

다음 표에는 이 작업에서 반환하는 일반적인 상태 코드가 나열되어 있습니다. 상태 코드의 전체 목록은 HTTP 상태 코드를 참조하세요.

HTTP 상태 코드 Description
204 콘텐츠 없음 삭제 작업에 성공했습니다.
404 찾을 수 없음 문서를 찾을 수 없습니다.

본문

없음

예제

DELETE https://querydemo.documents.azure.com/dbs/testdb/colls/testcoll/docs/SalesOrder3 HTTP/1.1  
x-ms-documentdb-partitionkey: ["Account1"]  
x-ms-date: Tue, 29 Mar 2016 02:03:07 GMT  
authorization: type%3dmaster%26ver%3d1.0%26sig%3dvR4ZglipsSQvOX176KTSLz7G21rfxS784sxfUEae4N0%3d  
Cache-Control: no-cache  
User-Agent: Microsoft.Azure.Documents.Client/1.6.0.0  
x-ms-version: 2015-12-16  
Accept: application/json  
Host: querydemo.documents.azure.com  
Cookie: x-ms-session-token#0=775; x-ms-session-token=775  
Content-Length: 0  
  
HTTP/1.1 204 No Content  
Cache-Control: no-store, no-cache  
Pragma: no-cache  
Content-Length: 0  
Content-Type: application/json  
Content-Location: https://querydemo.documents.azure.com/dbs/testdb/colls/testcoll/docs/SalesOrder3  
Server: Microsoft-HTTPAPI/2.0  
Strict-Transport-Security: max-age=31536000  
x-ms-resource-quota: documentSize=10240;documentsSize=10485760;collectionSize=10485760;  
x-ms-resource-usage: documentSize=0;documentsSize=2;collectionSize=2;  
x-ms-alt-content-path: dbs/testdb/colls/testcoll  
x-ms-content-path: d9RzAJRFKgw=  
x-ms-request-charge: 9.33  
x-ms-activity-id: 01b5b7fc-824d-4945-b6ce-4eb3532584a1  
x-ms-session-token: 0:776  
Set-Cookie: x-ms-session-token#0=776; Domain=querydemo.documents.azure.com; Path=/dbs/testdb/colls/testcoll  
Set-Cookie: x-ms-session-token=776; Domain=querydemo.documents.azure.com; Path=/dbs/testdb/colls/testcoll  
Date: Tue, 29 Mar 2016 02:03:07 GMT  
  

참고 항목