【发布时间】:2015-11-20 12:28:49
【问题描述】:
我无法列出服务器上 Meteor 应用程序中创建的所有集合。
集合坐.../root/packages/lib/collectionName.js
collectionName 操作成功。但是,由于我有很多集合,我需要一个函数来检索创建的集合的所有名称。
在一个服务器函数中在集合被加载之后,一个方法执行下面的函数;
MyCollection = Mongo.Collection.getAll();
console.log(MyCollection);
[ { name: 'users',
instance:
{ _makeNewID: [Function],
_transform: null,
_connection: [Object],
_collection: [Object],
_name: 'users',
_driver: [Object],
_restricted: true,
_insecure: undefined,
_validators: [Object],
_prefix: '/users/' },
options: undefined },
{ name: 'MeteorToys/Impersonate',
instance:
{ _makeNewID: [Function],
....
Meteor 创建的用户集合在那里。但是所有创建的集合,其中3个带有Collection2包的集合都没有显示。
我错过了什么?
如果我需要 child_process 库并执行一系列命令..“meteor mongo”...“db.getCollectionNames()”会有什么影响?
【问题讨论】: