note 124121 added to mongodb.tutorial.library
| From: | salos_12 at hotmail dot com | Date: | Fri, 16 Aug 2019 19:16:38 +0000 |
| Subject: | note 124121 added to mongodb.tutorial.library | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-211895@lists.php.net to get a copy of this message | ||
When your database name contains a "-" (e.g. database-name) you need to use a string
instead.
<?php
$client = new MongoDB\Client("mongodb://ip_address:port");
$collection = $client->{'database-name'}->collection;
?>
----
Server IP: 208.43.231.9
Probable Submitter: 82.199.157.54 (proxied: 148.0.75.254)
----
Manual Page -- http://php.net/manual/en/mongodb.tutorial.library.php
Edit -- https://master.php.net/note/edit/124121
Del: integrated -- https://master.php.net/note/delete/124121/integrated
Del: useless -- https://master.php.net/note/delete/124121/useless
Del: bad code -- https://master.php.net/note/delete/124121/bad+code
Del: spam -- https://master.php.net/note/delete/124121/spam
Del: non-english -- https://master.php.net/note/delete/124121/non-english
Del: in docs -- https://master.php.net/note/delete/124121/in+docs
Del: other reasons-- https://master.php.net/note/delete/124121
Reject -- https://master.php.net/note/reject/124121
Search -- https://master.php.net/manage/user-notes.php