Skip to content

Instantly share code, notes, and snippets.

@mehlah
Created May 25, 2011 09:05
Show Gist options
  • Save mehlah/990635 to your computer and use it in GitHub Desktop.
Save mehlah/990635 to your computer and use it in GitHub Desktop.
Li3 Map reduce exemple
<?php
$db = Model::connection();
// construct map and reduce functions
$map = new \MongoCode("function() {}");
$reduce = new \MongoCode("function(k, vals) {}");
$metrics = $db->connection->command(array(
'mapreduce' => 'collection',
'map' => $map,
'reduce' => $reduce,
'out' => array()
));
?>
@mehlah
Copy link
Author

mehlah commented May 25, 2011

need to wrap that into a MongoDB finder that automatically takes care of the MongoCode() bits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment