mongodb - Complex Meteor Publication Isn't Reactively Updating As Expected -
I am working on a meteor app that uses many collections that will allow each other to have a tree-style organization In context. However, they all represent as flat collections in my database structure. For example, I have a high-level car
collection, a parts
collection and a seller
collection that looks like this (pseudo code) :
Cars {_id: make: model: year: etc ...} Parts {_id: carId: Cars._id type: desc: etc ...} Seller {_id: partId: Parts _id Location: Name: etc ...}
The way they refer to each other in the tree, they will look like this:
Car | ---- & gt; Part | | | ---- & gt; Seller | | | ---- & gt; Seller | | | ---- & gt; Seller | ---- & gt; Part | ---- & gt; Seller | ---- & gt; Etc ... The problem is that I use many top-level publications where I pass
and then underscore theCar._id
and I want to see all the codes. Sellers sellparts
for thatcar
. So in my path I have a subscription that looks like this:wait: function () {mention Meteor.subscribe ('allSellersByCar', this.params._id); }
Therefore return from
seller
tocar._id
, I get all theparts
Match the code> car ._id_. Use the sticks ()
topart._id
and all thevendor
whichpart._id
:Meteor.publish ('AllSellersByCar' corresponds to the array of functions (carId) {var parts = parts.find ({carId}: CarId}) .Fatch (); Return Sellers.Fund ({partId: { $ In: _.pluck (Parts, "_id")}}}}});
This method works fine and returns all the
vendor
. The problem is that this method is only used as thevendors
Because they are included in the existing code and the templates will be updated as expected, but this will not return anyseller
which adds to any newparts
Which is added to thecar
object, it seems that it only Ratikriya gives final line response. When a newpart
is added the whole query does not start again, but if you refresh the page (and therefore the route), then the query resumes and everything will be back properly. goes.There are many such publications in my app, some of which fetch many more before returning "middle-male" before, I'm not sure how to fix it or what's the problem. About the pub / Is all wrong? Will I make references more normal and add
carId
to eachseller
, so I can directly put it in thevendor
collection on the line Andparts
fetch? Do not go through
Comments
Post a Comment