prepareForget

Definition

Prepares to "forget" (redact) data. Wrapper for the forget command.

Syntax

db.prepareForget(collection,filter [,minVersion,maxVersion,inclusiveRange(true|false)])
FieldTypeMandatoryDescription
collectionstringMandatoryThe collection name which the documents belongs to.
filterdocumentMandatoryA filter identifying the documents to be forgotten
minVersion, maxVersionnumberOptionalIf specified, only purge the documents that are current within this range of versions.
inclusiveRangebooleanOptionalIf true, only forget documents that are within the range of versions ONLY. This means that any version outside of the range is unaffected. If false, then documents within the range will be forgotten even if they also exist in versions outside of the range. See forget for details

Example

db.prepareForget('docHistory3385955',{x:4},0,8000)
{
        "ok" : 1,
        "forgetId" : NumberLong(14),
        "password" : "5064ee4a-22f6-4cf8-a44e-8c2559322e1d",
        "forgetSummary" : {
                "documentsToBeForgotten" : NumberLong(10),
                "uniqueDocuments" : NumberLong(10)
        }
}

See also

forget