I am mounting a REST API in PHP and I am not able to display all the collections returned from the mongo search, returns only one. Follow the code for anyone who can make a contribution I'll be very grateful. =]!
private function slcTwitter($since, $until){
// Configuration
$dbhost = 'localhost:27017';
$dbname = 'twitter';
// Connect to twitter database
$m = new Mongo("mongodb://$dbhost");
$db = $m->$dbname;
// Get the users collection
$c_users = $db->twitter_lake;
// Find
$user = $c_users->find(array('text' => array('$all' => array(new mongoregex('/teste/i')))));
$result = Array();
foreach ($user as $doc) {$result = $doc;}
return $result;
}