TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Reactive Joins in Meteor

40 pointsby tmeasdayover 11 years ago

4 comments

jschmitz28over 11 years ago
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.
iamnotachoiceover 11 years ago
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>
contrahaxover 11 years ago
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 未加载
joshowensover 11 years ago
Great post, we were just talking about this stuff in the office today!
评论 #7155171 未加载