How to allocate space in Mongodb
Mongodb260
description
Clear the disk space occupied by the deleted data in the test table
command
db.runCommand({compact: "test" })
parameter
runCommand(command) : Run a command in the context of the current database {compact : <collection name> } : Rewrite and defragment all data and indexes in the collection. On the WiredTiger database, this command will release unnecessary disk space to the operating system
result
{ "ok" : 1.0 }