TypeError:Mongo.collection不是函数

时间:2017-05-25 01:34:07

标签: mongodb meteor collections

我是Meteor的新手。试图建立一个应用程序。当我添加这行代码时:    
export const Work = new Mongo.collection("work");  它给出了这个错误的文件:

  

W20170524-18:21:28.376(-7)? (STDERR)/Users/yusifkhalilov/.meteor/packages/meteor-tool/.1.4.4_2.1sgods7++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server -lib / node_modules /纤维/ future.js:280   
W20170524-18:21:28.377(-7)? (STDERR)throw(ex);   
W20170524-18:21:28.377(-7)? (STDERR)^   
W20170524-18:21:28.377(-7)? (STDERR)   
W20170524-18:21:28.377(-7)? (STDERR)TypeError:Mongo.collection不是函数   
W20170524-18:21:28.378(-7)? (STDERR)at meteorInstall.server.main.js(server / main.js:5:21)   
W20170524-18:21:28.378(-7)? (STDERR)在fileEvaluate(packages / modules-runtime.js:197:9)   
W20170524-18:21:28.378(-7)? (STDERR)at require(packages / modules-runtime.js:120:16)   
W20170524-18:21:28.379(-7)? (STDERR)/Users/yusifkhalilov/Documents/work/moving_company/.meteor/local/build/programs/server/app/app.js:52:1   
W20170524-18:21:28.379(-7)? (STDERR)/Users/yusifkhalilov/Documents/work/moving_company/.meteor/local/build/programs/server/boot.js:303:34   
W20170524-18:21:28.379(-7)? (STDERR)在Array.forEach(本机)   
W20170524-18:21:28.379(-7)? (STDERR)在函数。 .each。 .forEach(/Users/yusifkhalilov/.meteor/packages/meteor-tool/.1.4.4_2.1sgods7++os.osx.x86_64+web.browser + web.cordova / MT-os.osx.x86_64 / dev_bundle /服务器-LIB / node_modules /下划线/ underscore.js:79:11)   
W20170524-18:21:28.379(-7)? (STDERR)/Users/yusifkhalilov/Documents/work/moving_company/.meteor/local/build/programs/server/boot.js:128:5   
W20170524-18:21:28.379(-7)? (STDERR)/Users/yusifkhalilov/Documents/work/moving_company/.meteor/local/build/programs/server/boot.js:352:5   
W20170524-18:21:28.379(-7)? (STDERR)在Function.run(/Users/yusifkhalilov/Documents/work/moving_company/.meteor/local/build/programs/server/profile.js:510:12)

1 个答案:

答案 0 :(得分:3)

MongoDB区分大小写。使用资本" c"在你的收藏。你的代码必须是

export const Work = new Mongo.Collection(" work");