Is it possible to use FindFromPublication with reactive join packages such as publish-composite or publish-with-relations? If so, is there a sample I can look at?
Primarily I am looking to do something like
FindFromPublication.publish('user-organizations', function() {
return Organizations.find({
_id: {
$in: Meteor.users.find({_id: this.userId}).organizations
}
})
})
I have tried
FindFromPublication.publish('user-organizations', function() {
if (!this.userId) {
return
}
Meteor.publishWithRelations({
handle: this,
collection: Organizations,
filter: {},
mappings: [
{
key: 'organizations',
collection: Meteor.users,
filter: this.userId
}
],
options: {
fields: {
name: true
},
sort: {
name: 1
}
}
})
})
But it just gives me all the organizations.