1
I am assembling a REST API in PHP and I am not able to display all the returned Collections of the Mongo search, returns only one. Follow the code for those who can make a contribution I will 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;
}
GREAT!!! Thanks friend
– Christopher Tavares