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

Method setNonWinningRevisionBody

db/document.go:850–857  ·  view source on GitHub ↗

Adds a revision body (as []byte) to a document. Flags for external storage when appropriate

(revid string, body []byte, storeInline bool, hasAttachments bool)

Source from the content-addressed store, hash-verified

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) {
851 revBodyKey := ""
852 if !storeInline && len(body) > MaximumInlineBodySize {
853 revBodyKey = generateRevBodyKey(doc.ID, revid)
854 doc.addedRevisionBodies = append(doc.addedRevisionBodies, revid)
855 }
856 doc.History.setRevisionBody(revid, body, revBodyKey, hasAttachments)
857}
858
859// persistModifiedRevisionBodies writes new non-inline revisions to the bucket.
860// Should be invoked BEFORE the document is successfully committed.

Callers 2

setRevisionBodyMethod · 0.95

Calls 2

generateRevBodyKeyFunction · 0.85
setRevisionBodyMethod · 0.45

Tested by

no test coverage detected