MongoDB MapReduce 问题,在 codeigniter 中
我在 codeigniter 中使用 mongodb。
collections
'mtb'
'road'
'minivelo'
php
$map = new MongoCode('
function(){
....
}
');
$reduce = new MongoCode('
function(key, values){
....
}
');
$result = $this->mongo_db->command(array(
'mapreduce'=>$in, // <= 'mtb' 'road' 'minivelo'
'map'=>$map,
'reduce'=>$reduce,
'query'=>array(...)),
'out'=>'statistics'
));
如何从多个集合中获取 MapReduce 结果?
I am using mongodb in codeigniter.
collections
'mtb'
'road'
'minivelo'
php
$map = new MongoCode('
function(){
....
}
');
$reduce = new MongoCode('
function(key, values){
....
}
');
$result = $this->mongo_db->command(array(
'mapreduce'=>$in, // <= 'mtb' 'road' 'minivelo'
'map'=>$map,
'reduce'=>$reduce,
'query'=>array(...)),
'out'=>'statistics'
));
How could I get MapReduce result from several collections?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只能通过多个查询从多个集合中获取结果。 mongodb = 无连接。
看这个答案:
MongoDB 对多个集合进行映射/缩减?
you can only get results from several collections with several queries. mongodb = no joins.
see this answer:
MongoDB map/reduce over multiple collections?