2

When trying to execute:

db.site-09-15-17-19.renameCollection('site-09-18-17')

I get:

E QUERY    SyntaxError: Unexpected token ILLEGAL

I am not sure what I did wrong here.. I can use the site-09-15-17-19 collection just fine, just can't rename it.

Jafo
  • 1,200
  • 2
  • 11
  • 22

1 Answers1

0

You can use runCommand to rename collection. Before you run the command change to admin db

use admin
db.runCommand({renameCollection:"testdb.site-09-15-17-19",to:"testdb.site-09-18-17"})