我寫這個集合中檢索圖片:流星:收藏
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"})]
});
與自動窗體做了一個表格。
{{> quickForm collection="GiftCards" id="giftCardsForm" type="insert"}}
數據寫入,但我沒有找到一個方法來顯示與集合中的每個文檔相關的圖像......我只有ID(列在FileID),並沒有找到發佈正確的圖像與它指的特定文檔的方式...
你有沒有檢查出CollectionFS [文件](https://github.com/CollectionFS/Meteor-CollectionFS#顯示的上傳的圖像)? –
是的,但我認爲問題更多關於mongodb和關係 - 我不太瞭解NoSQL .....與MySQL我做了一個連接,並採取我需要的...... –
然後你可以分享pub sub您編寫的代碼將數據發送給客戶端?也許有什麼地方是錯誤的.. –