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

Method GetDocumentCurrentVersion

db/util_testing.go:852–860  ·  view source on GitHub ↗

GetDocumentCurrentVersion fetches the document by key and returns the current version

(t testing.TB, key string)

Source from the content-addressed store, hash-verified

850
851// GetDocumentCurrentVersion fetches the document by key and returns the current version
852func (c *DatabaseCollection) GetDocumentCurrentVersion(t testing.TB, key string) (source string, version uint64) {
853 ctx := base.TestCtx(t)
854 doc, err := c.GetDocument(ctx, key, DocUnmarshalSync)
855 require.NoError(t, err)
856 if doc.HLV == nil {
857 return "", 0
858 }
859 return doc.HLV.SourceID, doc.HLV.Version
860}
861
862// UpsertTestDocWithVersion upserts document 'key' with the specified body and version. Used for testing with
863// version values specified by the test.

Calls 2

GetDocumentMethod · 0.95
TestCtxFunction · 0.92