db.runCommand Unexpected token ILLEGAL

Viewed 110

After running this line of code

 db.runCommand({convertToCapped: "mail_logs", size: 29250000‬ }) 

in Mongo Shell, I get this error:

Error: Line 1: Unexpected token ILLEGAL

2 Answers

I bumped into the same issue, the problem was caused by the double quotes breaking the JSON command issued.

If you haven't solved by now, try

db.runCommand({convertToCapped:'mail_logs', size: 29250000‬});

In fact, we just restarted the shell and it worked :)

Related