[SERVER-3607] no such cmd: compact Created: 16/Aug/11  Updated: 15/Nov/21  Resolved: 16/Aug/11

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 1.8.2
Fix Version/s: None

Type: Question Priority: Minor - P4
Reporter: Arie Grapa Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

From (http://www.mongodb.org/display/DOCS/compact+Command) I understand I should call the compact command every once in a while, on the slaves, and, as you recommend, run the script (https://github.com/mongodb/mongo-snippets/blob/master/js-scripts/compact-example.js) periodically on the master to have it become a slave and run it too. When connecting directly to the mongod box CLI and running the command, it doesn't seem to understand it:

rs_1:SECONDARY> db.runCommand(

{compact:"user",dev:true}

)
{
"errmsg" : "no such cmd: compact",
"bad cmd" :

{ "compact" : "user", "dev" : true }

,
"ok" : 0
}



 Comments   
Comment by Eliot Horowitz (Inactive) [ 16/Aug/11 ]

That is only in 1.9.1+

Generated at Thu Feb 08 03:03:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.