Reputation: 777
I can't figure out how to drop a collection named "did-it-break?"
I've tried the usual way:
db.did-it-break?.drop()
but no, its not working. it outputs
[thread1] SyntaxError: expected expression, got keyword 'break'
Upvotes: 0
Views: 154
Reputation: 7474
Simply reference the collection name using brackets instead of the dot:
db['did-it-break?'].drop()
Always use brackets if you cannot type some name using the dot notation.
Upvotes: 1