{"id":699,"hash":"a875bd3bb44d78a5912f67971900045037d76ea9a179cdb9aa30dae0d29c43b1","pattern":"MongoError: ns not found when try to drop collection","full_message":"Mongoose throw an error i.e, \"MongoError: ns not found\" when i try to drop collection.\n\nHere is my mongoose code:\n\nvar mongoose = require('bluebird').promisifyAll(require('mongoose'));\n......\n......\n......   \nmongoose.connection.db.dropCollection(\"myCollection\",function(err,affect){\n   console.log('err',err);\n\n})\n\nError:\n\n  err { [MongoError: ns not found]\n\n  name: 'MongoError',\n\n   message: 'ns\n  not found',\n\n  ok: 0,\n\n  errmsg: 'ns not found' }","ecosystem":"npm","package_name":"node.js","package_version":null,"solution":"MongoError: ns not found occurs when performing actions on collections that don't exist.\n\nFor example, attempting to drop indexes before an explicit collection creation has occurred or before adding a document to the collection which implicitly creates the collection.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/37136204/mongoerror-ns-not-found-when-try-to-drop-collection","votes":98,"created_at":"2026-04-19T04:51:30.407151+00:00","updated_at":"2026-04-19T04:51:30.407151+00:00"}