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

Method PutExistingRev

db/crud.go:1558–1568  ·  view source on GitHub ↗

Adds an existing revision to a document along with its history (list of rev IDs.)

(ctx context.Context, newDoc *Document, docHistory []string, noConflicts bool, forceAllConflicts bool, existingDoc *sgbucket.BucketDocument, docUpdateEvent DocUpdateType)

Source from the content-addressed store, hash-verified

1556
1557// Adds an existing revision to a document along with its history (list of rev IDs.)
1558func (db *DatabaseCollectionWithUser) PutExistingRev(ctx context.Context, newDoc *Document, docHistory []string, noConflicts bool, forceAllConflicts bool, existingDoc *sgbucket.BucketDocument, docUpdateEvent DocUpdateType) (doc *Document, newRevID string, err error) {
1559 opts := PutDocOptions{
1560 NewDoc: newDoc,
1561 RevTreeHistory: docHistory,
1562 NoConflicts: noConflicts,
1563 ForceAllowConflictingTombstone: forceAllConflicts,
1564 ExistingDoc: existingDoc,
1565 DocUpdateEvent: docUpdateEvent,
1566 }
1567 return db.PutExistingRevWithConflictResolution(ctx, opts)
1568}
1569
1570// PutDocOptions encapsulates the options for putting a document revision.
1571type PutDocOptions struct {

Callers 3

TestOnDemandImportFunction · 0.80

Tested by 1

TestOnDemandImportFunction · 0.64