【发布时间】:2015-06-23 17:39:22
【问题描述】:
在/Project/lib文件夹中,我先声明一个FS.Store.GridFS:
imageStore = new FS.Store.GridFS("images", {
transformWrite: function(file, readStream, writeStream){
if (something) {...}
else {
Images.remove({_id: file._id});
}
}
}
然后我声明图像集合:
Images = new FS.Collection("images", {
stores: imageStore
});
但是,在编译时,我得到了错误:
=> Exited with code: 8
...
W20150623-13:06:51.855(-4)? (STDERR) throw(ex);
W20150623-13:06:51.855(-4)? (STDERR) ^
W20150623-13:06:51.855(-4)? (STDERR) ReferenceError: Images is not defined
...
我尝试将 imageStore 声明放在 Images 声明中,但没有成功。
但是重要的是,不只是Images 会因为未定义而导致错误。如果我包含 any 变量名称,它似乎在 else 语句中未定义。
最重要的是,确切的代码适用于我的朋友...... 任何帮助将不胜感激。
【问题讨论】:
标签: javascript meteor compilation scope collectionfs