Database Operations in MongoDB 3.6
Last updated: 2020-02-26 09:54:29PDF
If you repeatedly drop a database and then create a new database with the same name in for a MongoDB 3.6 instance, an error "database does not exist" may occur when you try to read, write to or drop this database, as shown below:
It is a common problem, which may be caused by mongos not refreshing its metadata cache. For more information, see official explanation, as shown below:
Select one of the following two solutions for troubleshooting:
- Restart mongos on the console.
- Run the flushRouterConfig command. Click the link to see detailed description.