note 125690 added to class.mongodb-driver-query

From: Date: Mon, 18 Jan 2021 09:46:45 +0000
Subject: note 125690 added to class.mongodb-driver-query
Groups: php.notes 
Request: Send a blank email to php-notes+get-216186@lists.php.net to get a copy of this message
# constructing a to a remote server and querry and limiting the result to the latest 3 results $username ="yourusername"; $password = "yourpasswort"; $manager = new MongoDB\Driver\Manager("mongodb://yourserver.com/", array("username" => $username, "password" => $password ) ); # setting your options and filter $filter = []; $options = ['sort'=>array('_id'=>-1),'limit'=>3]; # limit -1 from newest to oldest #constructing the querry $query = new MongoDB\Driver\Query($filter, $options); #executing $cursor = $manager->executeQuery('resultdb.test', $query); echo "dumping results<br>"; foreach ($cursor as $document) { var_dump($document); } ---- Server IP: 45.112.84.4 Probable Submitter: 195.138.250.34 (proxied: 2001:16b8:2b47:b600:b4bd:be10:34:75ba) ---- Manual Page -- http://php.net/manual/en/class.mongodb-driver-query.php Edit -- https://master.php.net/note/edit/125690 Del: integrated -- https://master.php.net/note/delete/125690/integrated Del: useless -- https://master.php.net/note/delete/125690/useless Del: bad code -- https://master.php.net/note/delete/125690/bad+code Del: spam -- https://master.php.net/note/delete/125690/spam Del: non-english -- https://master.php.net/note/delete/125690/non-english Del: in docs -- https://master.php.net/note/delete/125690/in+docs Del: other reasons-- https://master.php.net/note/delete/125690 Reject -- https://master.php.net/note/reject/125690 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#216186) next »