node.js - How do I delete a defined schema from Mongoose? -


i using node.js , mongoose interface mongodb. current implementation dynamically creates mongoose schemas during runtime. these schemas used create objects stored in respective collections in mongodb. @ point, delete function (express endpoint) might called deletes 1 or more of these collections , it's schema reference code (sets undefined). however, when go re-creating 1 of these schemas, mongoose complains old 1 exists!

any ideas?

try below make me understand if there same problam:

mongoose.connection.collections['yourcollectionname'].drop( function(err) {     console.log('collection dropped'); }); 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -