私は今日流星を使い始めたばかりで、何が間違っているのか理解できないようです。公開関数内で実行されているクエリがありますが、このクエリは別のクエリの結果によってフィルタリングされます。
つまり、公開されているデータベース(CollectionTwo)にドキュメントを追加すると、期待どおりに機能しますが、フィルタリングに使用されているデータベース(CollectionOne)に変更を加えると、meteorは反応的に動作しません。 。
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 )} )
)
一方、クライアントでは...
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 )} )
)
適切な解決策は何か考えはありますか?