Created
December 5, 2012 18:31
-
-
Save drewkerrigan/4218222 to your computer and use it in GitHub Desktop.
php multi-get mapred
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require("riak-php-client/riak.php"); | |
$client = new RiakClient('127.0.0.1', 8098); | |
$mr = new RiakMapReduce($client); | |
$keys = array("TFrWAVz8RRVEEqCH3nS27O4InLB","FEwZgNI4VTJSIZxSas0QpOCCXjn","EkSkmblyIAT5VL7xYpScP2GP71G"); | |
foreach ($keys as $key) { | |
$mr->add("local_ns~users", $key); | |
} | |
$mr->map("Riak.mapValues"); | |
$res = $mr->run(); | |
var_dump($res); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for sharing this solution! Do you know if this is guaranteed to return results in the order given in the
$keys
array? My tests show that this is the case, but it would be great if you could confirm it too.