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

Method PutDocInCollection

rest/utilities_testing_resttester.go:152–156  ·  view source on GitHub ↗

PutDocInCollection will upsert the document with a given contents in the given collection.

(collection, docID, body string)

Source from the content-addressed store, hash-verified

150
151// PutDocInCollection will upsert the document with a given contents in the given collection.
152func (rt *RestTester) PutDocInCollection(collection, docID, body string) DocVersion {
153 rawResponse := rt.SendAdminRequest(http.MethodPut, fmt.Sprintf("/%s.%s/%s", rt.GetDatabase().Name, collection, docID), body)
154 RequireStatus(rt.TB(), rawResponse, 201)
155 return DocVersionFromPutResponse(rt.TB(), rawResponse)
156}
157
158// UpdateDocRev updates a document at a specific revision and returns the new version. Deprecated for UpdateDoc.
159func (rt *RestTester) UpdateDocRev(docID, revID, body string) string {

Calls 5

SendAdminRequestMethod · 0.95
GetDatabaseMethod · 0.95
TBMethod · 0.95
RequireStatusFunction · 0.85