Merging collections in Meteor

前端 未结 3 1832
被撕碎了的回忆
被撕碎了的回忆 2020-12-10 15:20

Imagine you have multiple collections you want displayed on a single social news feed, for example Posts and Users (new signups). How would you rea

3条回答
  •  清歌不尽
    2020-12-10 15:51

    I came across this problem and I was wondering if a mixed solution would be better (or at least more efficient):

    The solution proposed by David works great but, as he says, problems could arise when dealing with big collections.

    What about keeping a local collection (just in the client), merge both collections into that local one when template is created and then register an observer (or maybe an observer for each remote collection) to keep the local collection up to date?

提交回复
热议问题