compact
Removes information between two proven versions of the database
Definition
compact allows the compaction of data between two proven database versions.
The compact command has the following form:
{
"compact" : {
"startVersion" : <number>,
"endVersion" : <number>
}
}
The command accepts the following fields:
Field | Type | Mandatory |
---|---|---|
compact.startVersion | number | yes |
compact.endVersion | number | yes |
Output
The returned document contains a subset of the following fields:
Field | Type | Description |
---|---|---|
ok | number | The status of the command. |
proofsDeleted | number | The number of proofs deleted. |
versionsDeleted | number | The number of versions deleted. |
documentsDeleted | document | The number of documents deleted in the specified collections. |
Examples
Compact between two versions
The following command compacts documents between versions 100 and 200.
{
"compact" : {
"startVersion" : 100,
"endVersion" : 200
}
}
The response would be the following:
{
"ok" : 1,
"proofsDeleted" : NumberLong(0),
"versionsDeleted" : NumberLong(8),
"documentsDeleted" : {
"totalDocuments" : NumberLong(24),
"compactable7093681" : NumberLong(24)
}
}
Updated over 5 years ago
What’s Next