【问题标题】:Using meteor's Collection FS in Iron Router / Iron Cli在 Iron Router / Iron Cli 中使用流星的 Collection FS
【发布时间】:2016-04-11 06:38:42
【问题描述】:

在尝试为我的 Iron cli 生成的项目调整集合 fs 时,我一直在摸不着头脑。

Iron cli 使用 Iron 路由器。这是我正在关注的教程https://medium.com/@victorleungtw/how-to-upload-files-with-meteor-js-7b8e811510fa#.mdionmurk

第一个sn-p

var imageStore = new FS.Store.GridFS(“images”);

Images = new FS.Collection(“images”, {
 stores: [imageStore]
});

第二个是拒绝/允许规则

Images.deny({
 insert: function(){
 return false;
 },
 update: function(){
 return false;
 },
 remove: function(){
 return false;
 },
 download: function(){
 return false;
 }
 });

Images.allow({
 insert: function(){
 return true;
 },
 update: function(){
 return true;
 },
 remove: function(){
 return true;
 },
 download: function(){
 return true;
 }
});

第一个 sn-p 应该具体去哪里,第二个 sn-p 应该去哪里?如果有人想知道 iron-cli 的结构,这就是它的样子 https://github.com/iron-meteor/iron-cli

【问题讨论】:

    标签: meteor iron-router collectionfs


    【解决方案1】:

    根据生成的结构,您的第一个 sn-p 将进入 app/lib/collections,第二个将进入 app/server/collections

    【讨论】:

      猜你喜欢
      • 2015-09-21
      • 2017-07-15
      • 1970-01-01
      • 2016-03-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-10-22
      • 2016-06-30
      相关资源
      最近更新 更多