Czy Mongoid ma Map/Reduce?
Używam kodu Ruby do obliczenia sumy z tablicy zwróconej przez Mongoid.
Ale może używanie Map/Reduce może być szybsze, tyle że nie widzę żadnych dokumentów do Map Reduce na mongoid.org i Google dla
map reduce site:mongoid.org
Nie daje żadnego wyniku. (lub za pomocą MapReduce
lub Map/Reduce
)
Na stronie MongoDB są dokumenty
map reduce site:mongodb.org
Ale trzeba też użyć Map Reduce z Mongoidem.
17
Author: nonopolarity, 2010-09-15
1 answers
Możesz użyć map reduce z Mongoid tak, jak możesz bezpośrednio przez sterownik Ruby:
# Post is a Mongoid model...
Post.collection.map_reduce(map_function, reduce_function, options)
Aby zobaczyć kilka przykładów wykonywania map reduce w sterowniku Ruby, Zobacz ten post na blogu autorstwa Kyle ' a bankiera (opiekuna Sterownika Ruby MongoDB).
21
Author: PreciousBodilyFluids,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-09-16 00:33:23
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2010-09-16 00:33:23