GetDocSyncDataNoImport returns unmarshalled value of the _sync xattr. This gets *just* the Sync Metadata (_sync field) rather than the entire doc, for efficiency reasons. Unlike GetDocSyncData it does not check for on-demand import; this means it does not need to read the doc body from the bucket.
(ctx context.Context, docid string, level DocumentUnmarshalLevel)
| 227 | // reasons. Unlike GetDocSyncData it does not check for on-demand import; this means it does not |
| 228 | // need to read the doc body from the bucket. |
| 229 | func (db *DatabaseCollection) GetDocSyncDataNoImport(ctx context.Context, docid string, level DocumentUnmarshalLevel) (*SyncData, *HybridLogicalVector, error) { |
| 230 | xattrs, cas, err := db.dataStore.GetXattrs(ctx, docid, []string{base.SyncXattrName, base.VvXattrName}) |
| 231 | if err != nil { |
| 232 | return nil, nil, err |
| 233 | } |
| 234 | if len(xattrs[base.SyncXattrName]) == 0 { |
| 235 | return nil, nil, base.ErrXattrNotFound |
| 236 | } |
| 237 | doc, err := db.unmarshalDocumentWithXattrs(ctx, docid, nil, xattrs, cas, level) |
| 238 | if err != nil { |
| 239 | return nil, nil, err |
| 240 | } |
| 241 | return &doc.SyncData, doc.HLV, nil |
| 242 | } |
| 243 | |
| 244 | // OnDemandImportForGet. Attempts to import the doc based on the provided id, contents and cas. ImportDocRaw does cas retry handling |
| 245 | // if the document gets updated after the initial retrieval attempt that triggered this. |
no test coverage detected