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

Method BodyBytes

db/document.go:428–443  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

426}
427
428func (doc *Document) BodyBytes(ctx context.Context) ([]byte, error) {
429 if doc._rawBody != nil {
430 return doc._rawBody, nil
431 }
432
433 if doc._body == nil {
434 return nil, nil
435 }
436
437 bodyBytes, err := base.JSONMarshal(doc._body)
438 if err != nil {
439 return nil, pkgerrors.Wrapf(err, "Error marshalling document body")
440 }
441 doc._rawBody = bodyBytes
442 return doc._rawBody, nil
443}
444
445// Builds the Meta Map for use in the Sync Function. This meta map currently only includes the user xattr, however, this
446// can be expanded upon in the future.

Callers 15

handleSyncFnDryRunMethod · 0.95
WaitForDocVersionMethod · 0.95
WaitForCVMethod · 0.95
IsSGWriteMethod · 0.95
getRevisionBodyJSONMethod · 0.95
updateAndReturnDocMethod · 0.95
setRevisionBodyMethod · 0.45
getCurrentVersionMethod · 0.45
importDocMethod · 0.45
SyncFnDryRunMethod · 0.45
resolveDocLocalWinsMethod · 0.45

Calls 1

JSONMarshalFunction · 0.92

Tested by 2

WaitForDocVersionMethod · 0.76
WaitForCVMethod · 0.76