【发布时间】:2016-05-31 01:01:17
【问题描述】:
我创建了一个名为 votes 的 mongo 集合,即使在将包更新到最新的流星版本后它也能正常工作。我不记得更改了工作代码的任何部分,但是我收到了这个错误。我使用meteor update 命令更新了项目,并在更新后立即对其进行了测试。那个时候它运行成功,但我不知道为什么会出现这个错误。而且,不确定我应该添加哪个源文件以获得帮助...
谁能解释一下?
W20141025-21:29:08.640(6)? (STDERR)
W20141025-21:29:08.641(6)? (STDERR) /home/wasi/.meteor/packages/meteor-tool/.1.0.34.k7p01x++os.linux.x86_32+web.browser+web.cordova/meteor-tool-os.linux.x86_32/dev_bundle/lib/node_modules/fibers/future.js:173
W20141025-21:29:08.641(6)? (STDERR) throw(ex);
W20141025-21:29:08.642(6)? (STDERR) ^
W20141025-21:29:08.693(6)? (STDERR) Error: A method named '/votes/insert' is already defined
W20141025-21:29:08.695(6)? (STDERR) at packages/ddp/livedata_server.js:1439
W20141025-21:29:08.696(6)? (STDERR) at Function._.each._.forEach (packages/underscore/underscore.js:113)
W20141025-21:29:08.697(6)? (STDERR) at _.extend.methods (packages/ddp/livedata_server.js:1437)
W20141025-21:29:08.697(6)? (STDERR) at Mongo.Collection._defineMutationMethods (packages/mongo/collection.js:884)
W20141025-21:29:08.698(6)? (STDERR) at new Mongo.Collection (packages/mongo/collection.js:208)
W20141025-21:29:08.699(6)? (STDERR) at app/collections/collection.js:1:43
W20141025-21:29:08.700(6)? (STDERR) at app/collections/collection.js:58:3
W20141025-21:29:08.701(6)? (STDERR) at /home/wasi/AI/OVS/.meteor/local/build/programs/server/boot.js:168:10
W20141025-21:29:08.702(6)? (STDERR) at Array.forEach (native)
W20141025-21:29:08.702(6)? (STDERR) at Function._.each._.forEach (/home/wasi/.meteor/packages/meteor-tool/.1.0.34.k7p01x++os.linux.x86_32+web.browser+web.cordova/meteor-tool-os.linux.x86_32/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
=> Exited with code: 8
=> Your application is crashing. Waiting for file change.
[=================== ] 94% 4.8s
【问题讨论】:
-
很可能您正在重新定义
votes集合。 -
@ChristianFritz 哦!知道了。我的项目备份文件夹偶然被粘贴在项目根目录上。 Meteor 合并了所有子目录,因此
votes集合被重新定义。谢谢!
标签: javascript mongodb meteor