现在我有了带有 MongoDB 地理索引的 Meteor 应用程序。
我正在使用这种发布/订阅:
Meteor.publish('items', function itemsPublication(NELat, NELong, SWLat, SWLong) {
return Items.find({
$and: [
{
'till': {
$gte: new Date()
}
},
{
'o': { $geoWithin: { $box: [ [ SWLong,SWLat], [ NELong, NELat] ] } }
}
]
}, {
fields: {
o: 1,
t: 1,
}
})
})
我添加了一些索引,例如:
Item._ensureIndex({
'till':1, 'o': '2dsphere'
})
一切正常...
主要问题是:是否可以将 Meteor pub/sub + MongoDB Geo-indexes 更改为 Apollo subs + graph.cool 作为后端 + Algolia 超快速地理搜索?
我需要真正的反应,而不需要轮询或其他东西......