Deletes a document, by adding a new revision whose _deleted property is true.
(ctx context.Context, docid string, docVersion DocVersion)
| 3203 | |
| 3204 | // Deletes a document, by adding a new revision whose _deleted property is true. |
| 3205 | func (db *DatabaseCollectionWithUser) DeleteDoc(ctx context.Context, docid string, docVersion DocVersion) (string, *Document, error) { |
| 3206 | versionKey, versionStr := docVersion.Body1xKVPair() |
| 3207 | body := Body{BodyDeleted: true, versionKey: versionStr} |
| 3208 | newRevID, doc, err := db.Put(ctx, docid, body) |
| 3209 | return newRevID, doc, err |
| 3210 | } |
| 3211 | |
| 3212 | // Purges a document from the bucket (no tombstone) |
| 3213 | func (db *DatabaseCollectionWithUser) Purge(ctx context.Context, key string, needsAudit bool) error { |