<?php /** * just a few ideas/case uses */ p($this->getUsers())->limit(1000)->map(function ($user) { // process the user return p::emit($user['id'], $user); })->each(function ($userData) { // save the data }); // alternative (PHP 5.5) syntax p($this)->map(function ($value, &$key) { $key = 4545; }); // alternative (PHP 5.5) syntax p($this)->map(function ($value, $key) { (yield $key => $value); }); p($this)->map('$k=$v*2'); /** * process max 100 users at once, 1000 times */ p($this->getUsers())->chunk(100)->limit(1000)->each(function ($usersChunk) { foreach ($usersChunk as $user) { print "{$user->id} \n"; } }); /** * Push and next */