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

Method setRevisionBody

db/document.go:839–847  ·  view source on GitHub ↗

Adds a revision body (as Body) to a document. Removes special properties first.

(ctx context.Context, revid string, newDoc *Document, storeInline, hasAttachments bool)

Source from the content-addressed store, hash-verified

837
838// Adds a revision body (as Body) to a document. Removes special properties first.
839func (doc *Document) setRevisionBody(ctx context.Context, revid string, newDoc *Document, storeInline, hasAttachments bool) {
840 if revid == doc.GetRevTreeID() {
841 doc._body = newDoc._body
842 doc._rawBody = newDoc._rawBody
843 } else {
844 bodyBytes, _ := newDoc.BodyBytes(ctx)
845 doc.setNonWinningRevisionBody(revid, bodyBytes, storeInline, hasAttachments)
846 }
847}
848
849// Adds a revision body (as []byte) to a document. Flags for external storage when appropriate
850func (doc *Document) setNonWinningRevisionBody(revid string, body []byte, storeInline bool, hasAttachments bool) {

Callers 1

Calls 3

GetRevTreeIDMethod · 0.45
BodyBytesMethod · 0.45

Tested by

no test coverage detected