MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / PurgeDoc

Method PurgeDoc

rest/api_test_helpers.go:29–35  ·  view source on GitHub ↗

prugeDoc removes all the revisions (active and tombstones) of the specified document.

(docID string)

Source from the content-addressed store, hash-verified

27
28// prugeDoc removes all the revisions (active and tombstones) of the specified document.
29func (rt *RestTester) PurgeDoc(docID string) {
30 response := rt.SendAdminRequest(http.MethodPost, fmt.Sprintf("/%s/_purge", rt.GetSingleKeyspace()), fmt.Sprintf(`{"%s":["*"]}`, docID))
31 RequireStatus(rt.TB(), response, http.StatusOK)
32 var body map[string]interface{}
33 require.NoError(rt.TB(), base.JSONUnmarshal(response.Body.Bytes(), &body))
34 require.Equal(rt.TB(), body, map[string]interface{}{"purged": map[string]interface{}{docID: []interface{}{"*"}}})
35}
36
37// PutDocResponse should be replaced with functions that return DocVersion.
38type PutDocResponse struct {

Callers 2

Calls 6

SendAdminRequestMethod · 0.95
GetSingleKeyspaceMethod · 0.95
TBMethod · 0.95
JSONUnmarshalFunction · 0.92
RequireStatusFunction · 0.85
EqualMethod · 0.45

Tested by 2