GetDocumentCurrentVersion fetches the document by key and returns the current version
(t testing.TB, key string)
| 850 | |
| 851 | // GetDocumentCurrentVersion fetches the document by key and returns the current version |
| 852 | func (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. |