note 113246 added to mongo.tutorial
| From: | pgl at yoyo dot org | Date: | Tue, 17 Sep 2013 13:44:51 +0000 |
| Subject: | note 113246 added to mongo.tutorial | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-196280@lists.php.net to get a copy of this message | ||
To use a collection with periods in its name, quote it with braces:
<?php
$m = new MongoClient();
$cursor = $m->test->{'test.test'}->find();
## equivalent to the following:
#$db = $m->test;
#$collection = $db->{'test.test'};
#$cursor = $collection->find();
foreach ($cursor as $doc) {
print_r($doc);
?>
----
Server IP: 69.147.83.199
Probable Submitter: 213.165.175.242
----
Manual Page -- http://php.net/manual/en/mongo.tutorial.php
Edit -- https://master.php.net/note/edit/113246
Del: integrated -- https://master.php.net/note/delete/113246/integrated
Del: useless -- https://master.php.net/note/delete/113246/useless
Del: bad code -- https://master.php.net/note/delete/113246/bad+code
Del: spam -- https://master.php.net/note/delete/113246/spam
Del: non-english -- https://master.php.net/note/delete/113246/non-english
Del: in docs -- https://master.php.net/note/delete/113246/in+docs
Del: other reasons-- https://master.php.net/note/delete/113246
Reject -- https://master.php.net/note/reject/113246
Search -- https://master.php.net/manage/user-notes.php