prugeDoc removes all the revisions (active and tombstones) of the specified document.
(docID string)
| 27 | |
| 28 | // prugeDoc removes all the revisions (active and tombstones) of the specified document. |
| 29 | func (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. |
| 38 | type PutDocResponse struct { |