Created
December 26, 2017 02:27
-
-
Save Jul10l1r4/8c5b26b0ff7872592f5921dc815a2850 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
try{ | |
$mongo = new MongoDB\Driver\Manager(); | |
$query = new mongoDB\Driver\Query([], ['sort' => ['nome' => 1], 'limit' => 5]); | |
$rows = $mongo->executeQuery("teste.clientes", $query); | |
foreach($rows as $row){ | |
echo "$row->nome:$row->profissao\n"; | |
} | |
}catch (MongoDB\Drive\Exception\Exception $e){ | |
echo "fudeu na linha ".$e->getLine()." foi ".$e->getMessage(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment