Comments (3)
It don't think publishComposite is well suited to this use case. Sorry!
from meteor-publish-composite.
Yeah, I think its a problem with mongo more than anything.
This works, but its super inefficient:
Meteor.publish 'feed', (limit) ->
sub = this
userId = @userId
followIds = null
postIds = null
publishFollows = observer sub, () ->
followIds = {}
Follows.find({userId:userId}).observeChanges
added: (id, doc) ->
followIds[id] = doc.followId
sub.added('follows', id, doc)
publishStars()
removed: (id) ->
delete followIds[id]
sub.removed('follows', id)
publishStars()
publishStars = observer sub, () ->
postIds = {}
Stars.find({userId: {$in: _.keys(followIds)}).observeChanges
added: (id, doc) ->
postIds[id] = null
sub.added('stars', id, doc)
publishPosts()
removed: (id) ->
delete postIds[id]
sub.removed('stars', id)
publishPosts()
publishPosts = observer sub, () ->
Posts.find({_id: {$in: _.keys(postIds)}}, {sort: {name:1, date:-1}, limit:limit}).observeChanges
added: (id, doc) ->
sub.added('posts', id, doc)
changed: (id, fields) ->
sub.changed('posts', id, fields)
removed: (id) ->
sub.removed('posts', id)
from meteor-publish-composite.
hello, I am dealling with the same problem, anyone found a solution ?
from meteor-publish-composite.
Related Issues (20)
- Empty children HOT 4
- Publish loses reactivity after "load more" HOT 4
- Move to Meteor-Community-Packages organization? HOT 1
- All published records removed and re-added on subsequent subscriptions in 1.7.1 HOT 4
- Error: Doc not found in list HOT 1
- Join Data from Array of ID's HOT 1
- Exception in callback of async function: TypeError: Converting circular structure to JSON HOT 2
- Declaration file for TypeScript HOT 5
- [Question] How to use it together with middleware ? HOT 1
- Full compatibility with johanbrook:publication-collector
- children function won't rerun reactively
- Meteor collection hook direct not working
- Unset fields are not unset HOT 3
- Add TypeScript types HOT 1
- Remove underscore HOT 16
- Create GitHub action to run tests HOT 3
- Publications are ready before object merges are complete since 1.8.2 HOT 11
- Unhandled promise rejection HOT 3
- Error: Doc not found in list HOT 14
- TypeError: this.observeHandle.stop is not a function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-publish-composite.