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  Car._id  and I want to see all the codes. Sellers sell  parts  for that  car . 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 to car._id , I get all the parts Match the code> car ._id and then underscore the _. Use the sticks () to part._id and all the vendor which part._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 the vendors Because they are included in the existing code and the templates will be updated as expected, but this will not return any seller which adds to any new parts Which is added to the car object, it seems that it only Ratikriya gives final line response. When a new part 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 each seller , so I can directly put it in the vendor collection on the line And parts fetch? Do not go through


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -