好的,这是工作代码,谢谢@PaulS.
db = MongoInternals.defaultRemoteCollectionDriver().mongo.db; collections = db.listCollections(); collections.each(function(n, collection){ if(collection){ console.log( collection.name ); } });