2011-05-27 56 views
8

我试图在PHPillow中执行reduce函数(的MapReduce),目前它没有记录,但是我真的需要这样做。有没有人有一个在PHPillow中实现Reduce功能的例子?在PHPillow for CouchDB中减少函数

http://arbitracker.org/phpillow/download.html <凹口 - 的PHPillow

我已经与来自被褥或法线贴图功能,这样做没有问题,它的减少功能,我被耽误了。

这是在代码

* A reduce function may be used to aggregate/reduce the results 
* calculated by a view function. See the CouchDB documentation for more 
* results: @TODO: Not yet documented. 
* 
* Each view reduce function MUST have a view definition with the same 
* name, otherwise there is nothing to reduce. 

感谢您的帮助,

--Scott

回答

1

我会开始说我不知道​​很多PHPillow或CouchDB的的。

但是,通过它的外观,Reduce功能被写入并注册在CouchDb服务器上。然后在view_file.php中引用它 - 根据它们的示例... 35-57行定义数组。

然后,当你调用verifyView()时,它将执行reduce定义,这意味着你可以通过$ views [$ name] ['reduce']来访问它。

正如我所说的,我只是从类中的小信息和couchdb关于reduce的信息中猜测出来的。