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 passand then underscore theCar._idand I want to see all the codes. Sellers sellpartsfor 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
sellertocar._id, I get all thepartsMatch the code> car ._id_. Use the sticks ()topart._idand all thevendorwhichpart._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 thevendorsBecause they are included in the existing code and the templates will be updated as expected, but this will not return anysellerwhich adds to any newpartsWhich is added to thecarobject, it seems that it only Ratikriya gives final line response. When a newpartis 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
carIdto eachseller, so I can directly put it in thevendorcollection on the line Andpartsfetch? Do not go through
Comments
Post a Comment