在MongoDB中使用$ in操作符的缓慢/糟糕的形式是否有很多可能性?
posts.find({
author : {
$in : ['friend1','friend2','friend3'....'friend40']
}
})
应用程序引擎,例如,不会让因为他们的阵中翻译每件直接到一个查询,所以不是强迫你使用他们的方法来处理fan out您使用超过30。虽然这可能是Mongo中最有效的方法,但它的代码显得更加复杂,所以我宁愿只使用这种泛型方法。
对于合理大小的数据集,Mongo会有效地执行这些$查询吗?
你在你的作者领域有一些索引吗? – shingara 2011-02-10 10:08:04
你好@Derek Dahmer,你能解决这个问题吗?我一直在处理这个问题。这名建筑师今天命名为Edge Collection by MongoDB :)我也希望使用$ in参数和巨大的数组。但我提防性能影响! http://image.slidesharecdn.com/socialitept2-140724104718-phpapp01/95/socialite-the-open-source-status-feed-part-2-managing-the-social-graph-18-638.jpg?cb= 1406222239 – efkan 2015-02-09 13:48:43