Gets the body of a revision's nearest ancestor, as raw JSON (without _id or _rev.) If no ancestor has any JSON, returns nil but no error.
(ctx context.Context, doc *Document, revid string)
| 807 | // Gets the body of a revision's nearest ancestor, as raw JSON (without _id or _rev.) |
| 808 | // If no ancestor has any JSON, returns nil but no error. |
| 809 | func (db *DatabaseCollectionWithUser) getAncestorJSON(ctx context.Context, doc *Document, revid string) ([]byte, error) { |
| 810 | for { |
| 811 | if revid = doc.History.getParent(revid); revid == "" { |
| 812 | return nil, nil |
| 813 | } else if body := doc.getRevisionBodyJSON(ctx, revid, db.RevisionBodyLoader); body != nil { |
| 814 | return body, nil |
| 815 | } |
| 816 | } |
| 817 | } |
| 818 | |
| 819 | // Returns the body of a revision given a document struct. Checks user access. |
| 820 | // If the user is not authorized to see the specific revision they asked for, |
no test coverage detected