在我的自定义包中未定义获取异常 Mongo

代码

ABC = new Mongo.Collection('ABC');

错误
W20140905-17:49:06.809(5.5)? (STDERR) /home/sandeep/.meteor/packages/meteor-tool/.1.0.27.18sl1cs++os.linux.x86_32+web.browser+web.cordova/meteor-tool-os.linux.x86_32/dev_bundle/lib/node_modules/fibers/future.js:173
W20140905-17:49:06.809(5.5)? (STDERR)                       throw(ex);
W20140905-17:49:06.810(5.5)? (STDERR)                             ^
W20140905-17:49:06.810(5.5)? (STDERR) ReferenceError: Mongo is not defined

最佳答案

您需要列出您在 package.js 文件中使用的所有包:

Package.onUse(function (api) {
  api.use('mongo', ['client', 'server']);
  ...
});

关于 meteor 0.9.1 ,Mongo 未在我的自定义包中定义,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25685985/

10-16 18:04