I just started using a meteorite today and can't understand what I'm doing wrong. I have a query that runs inside a publish function, but this query is filtered by the result of another query.
In short, when I add a document to the database that is published (CollectionTwo), it works as I would expect, but when I make my change to the database that is used for filtering (CollectionOne), the meteor does not, t lead yourself reactive.
CollectionOne = new Meteor.Collection("one")
CollectionTwo = new Meteor.Collection("two")
Meteor.publish("items", ->
not_hidden = CollectionOne.find().fetch()
return CollectionTwo.find( _id: {'$in':( t.my_id for t in not_hidden )} )
)
Meanwhile, on the client ...
CollectionOne = new Meteor.Collection("one")
CollectionTwo = new Meteor.Collection("two")
Meteor.subscribe("items")
_.extend( Template.items,
items: ->
not_hidden = CollectionOne.find().fetch()
return CollectionTwo.find( _id: {'$in':( t.my_id for t in not_hidden )} )
)
Any ideas what might be the appropriate solution?
source
share