I’ve accidentally named a view : "test..view".
When I try to delete it now I get the following error :
MongoInvalidArgumentError: Collection names cannot be empty
I tried running the following command :
db.getCollection("test..view").drop()
I also tried to rename it but got the same error.
2
Answers
You can use runCommand to solve this issue
Ultimately, the error
"Collection names cannot be empty"
comes from the client you're using, using Compass and the mongo node module triggered the issue for me. Using my system mongoshell didn't trigger that error.This seems to work: