TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Reactive Joins in Meteor

40 点作者 tmeasday超过 11 年前

4 条评论

jschmitz28超过 11 年前
This is a great article and seems to be really similar to a problem I had&#x2F;have at work (not using meteor though, and we use a relational DB). We have a system where clients can set up arbitrary queries about data for a project management type system with live updates. For example, you could quickly create a to do list by setting up a query to find all the Tasks not in the &quot;Completed&quot; state where you are the owner. Then you can specify any fields you want to see about that item, like priority or description. When an update happens, the server checks to see if the changed item is fulfilled by the query filter and publishes either an addition&#x2F;update with those fields included or a removal to the client who registered it.<p>I can imagine this scenario would scale much better using meteor to receive just the basic models (unjoined) but then doing the filter&#x2F;joins on the client side (I don&#x27;t use meteor, but from what I understand you can basically query the data you&#x27;ve received on the server from the client). That way, the server wouldn&#x27;t bear the burden of running almost identical queries for multiple clients who only differ in their user ID&#x27;s.
iamnotachoice超过 11 年前
Great article, have also been breeding on the Mongo&#x2F;Joins issue for quite some time and solved it for myself using Meteor Live Queries and selective data dublication: <a href="http://iamnotachoice.com/using-mongodb-requires-thinking-mongodb-live-queries-also-help/" rel="nofollow">http:&#x2F;&#x2F;iamnotachoice.com&#x2F;using-mongodb-requires-thinking-mon...</a>
contrahax超过 11 年前
Why not use backwards document references? Put the post id on each comment and query like Comments.find({post: post._id}, {limit: 30}) to get 30 comments. Why would you store all of the comments for a Post on the post itself?
评论 #7156813 未加载
评论 #7156317 未加载
joshowens超过 11 年前
Great post, we were just talking about this stuff in the office today!
评论 #7155171 未加载