Hi guys!
Please consider the following:
I have an Items
Mongo.Collection with all the available items of many suppliers. When a user (buyer) decides to open a new order, an OpenOrder
is created. When an item is added to this open order, a new entry is inserted into the OpenOrderBody
collection:
openorderitem = {
_id: ...,
amount: 3 (so user added this item 3 times),
rowId: 1 (position in list),
item: ITEM _ID IS HERE
}
The important key is the item
key which references this exact item in the Items
collection via its _id
.
Is there some nice way to populate the item
key on the server and send the populated OpenOrderBody
to the client?
I already tried meteor-collection-helpers and meteor-publish-composite but both do not really do what I want to do, as I still have to use the Items
collection on the client some way like this:
var actualItem = Items.findOne({ _id: openorderitem.item._id });
Is there someway around this?
I hope you guys understand what I want to achieve!
Thanks a bunch in advance,
best Patrick