Trying to get a list of collections from mongoose
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to return a list of a dbs collections using mongoose. I'm following the directions set out here but http://grokbase.com/t/gg/mongoose-orm/122xxxr7qy/mongoose-get-a-list-of-all-collections . So here is my code var mongoose = require('mongoose'); //if (mongoose.connection.readyState == 0){//checks if already connected to the database console.log("creating connection to the database"); var Config = require('../configs/config'); var config = new Config(); config = config.getConfig().db.dev; if (mongoose.connection.readyState = 0 ) {