Hello there,
I read some stuff in the forums of other people who issued the same thing.
Example:
I have an sales app wich contains some information on orders, but on the order detail page
On index view i have an table containing only three fields of the order information:
- shipping.first_name
- order_reference
- orderLines.price
The publication i use for this:
Meteor.publish(“ordersOverview”, function (limit) {
return Orders.find(
{},
{
fields : {order_ref:1,‘shipping.first_name’:1,orderLines.price:1},
limit:limit,
sort: {order_date: -1}
}
);
});
The subscription i use for this:
Template.ordersOverview.onCreated( function() {
this.subscribe('ordersOverview');
});
In the overview page i see the three fields which i needed and subscribed for.
But, when i navigate to the order detail page, i need more information of this order and need all the fields.
The publication i use for this:
Meteor.publish(“orderById”, function (_id) {
return Orders.find({_id:_id});
});
Now i get almost all fields, except some fields from the subdocuments orderLines and shipping.
I do get the requested shipping.first_name and orderLines.price but all the other fields in these subdocuments are missing. The top-level fields are okay and are there.
I read somewhere that this has something to do with mergebox and subdocuments, these won’t merge properly?
What can i do about this?