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

Method MutableBody

db/revision_cache_interface.go:226–232  ·  view source on GitHub ↗

MutableBody returns a deep copy of the given document revision as a plain body (without any special properties) Callers are free to modify any of this body without affecting the document revision.

()

Source from the content-addressed store, hash-verified

224// MutableBody returns a deep copy of the given document revision as a plain body (without any special properties)
225// Callers are free to modify any of this body without affecting the document revision.
226func (rev *DocumentRevision) MutableBody() (b Body, err error) {
227 if err := b.Unmarshal(rev.BodyBytes); err != nil {
228 return nil, err
229 }
230
231 return b, nil
232}
233
234// Body returns an unmarshalled body that is kept in the document revision to produce shallow copies.
235// If an unmarshalled copy is not available in the document revision, it makes a copy from the raw body

Callers 3

processRevMethod · 0.95
BenchmarkHandleRevDeltaFunction · 0.80

Calls 1

UnmarshalMethod · 0.45

Tested by 2

BenchmarkHandleRevDeltaFunction · 0.64