Hello everyone, I am Loupax and this is my first thread here. Nice meeting you
Yesterday, I attempted to update my application from Meteor 1.0.3.2
to Meteor 1.0.4.2
. I was having this query that was working, but not anymore:
Meteor.publish('NearbyMessages', function(point) {
var query = [];
// Gather all messages that are nearby
query.push({
'location':
$near: {
$geometry: {type: 'Point', coordinates: [point.longitude, point.latitude]},
$maxDistance: 1000
}
}
});
// Also gather all the messages made by this.userId
query.push({poster_id: this.userId});
return MessagesCollection.find({$or: query});
});
I remember that I had the exact same problem in times before Meteor 1.0
so when I saw this code running on Meteor 1.0.3.2
I thought that it was now possible and I didn’t have to worry about this thing anymore…
After that, I tried publishing the result of both queries doing something like this:
var self = this;
MessagesCollection.find(nearbyQuery).forEach(function(msg){
self.added('messages', msg._id, msg);
});
MessagesCollection.find(myMessagesQuery).forEach(function(msg){
self.added('messages', msg._id, msg);
});
self.ready()
This would publish the results of both queries, but the result doesn’t seem to be reactive anymore.
Is what I’m trying to do possible? Is it on the roadmap? Any suggestion is welcome