【发布时间】:2016-04-07 01:13:33
【问题描述】:
我正在给这个收藏写信:
GiftCards = new Mongo.Collection('giftcards');
GiftCards.attachSchema(new SimpleSchema({
cardType: {
type: String
},
cardValue: {
type: Number,
defaultValue: 100
},
fileId: {
type: String,
autoform: {
afFieldInput: {
type: "fileUpload",
collection: "Images"
}
}
}
}));
Images = new FS.Collection("images", {
stores: [new FS.Store.FileSystem("images", {path: "public/uploads"})]
});
使用 AutoForm 制作的表格。
{{> quickForm collection="GiftCards" id="giftCardsForm" type="insert"}}
数据已写入,但我找不到显示与集合中每个文档关联的图像的方法......我只有 id(在 fileId 中)并且找不到发布的方法使用它引用的特定文档正确图像...
【问题讨论】:
-
你有没有查看 CollectionFS documentation?
-
是的,但我认为问题更多是关于 mongodb 和关系 - 我不太了解 NoSQL ......我使用 MySQL 进行连接并获取我需要的东西......
-
那您能分享一下您编写的用于向客户端发送数据的 pub 子代码吗?也许那里出了点问题..
标签: meteor collectionfs