Results of 1 - 1 of about 1 for beers (0.001 sec.)
- Using the PHP Library for MongoDB (PHPLIB) | PHP 8.3 9414
- Using the PHP Library for MongoDB (PHPLIB) After the initial extension set-up, we will continue explaining how to get started with the corresponding userland library to write our first project. Installing the PHP Library with Composer The l
... ection-level operations (e.g. » CRUD methods, index management). As an example, this is how you insert a document into the beers collection of the demo database: <?php require 'vendor/autoload.php' ; // include Composer's autoloader $client = new Mong ... oDB\Client ( "mongodb://localhost:27017" ); $collection = $client -> demo -> beers ; $result = $collection -> insertOne ( [ 'name' => 'Hinterland' , 'brewery' => 'BrewDog' ] ); echo "Inserted with Object I ... clude Composer's autoloader $client = new MongoDB\Client ( "mongodb://localhost:27017" ); $collection = $client -> demo -> beers ; $result = $collection -> find ( [ 'name' => 'Hinterland' , 'brewery' => 'BrewDog' ] ); foreach ( $result as $entry ) { e ...
-
https://man.mtool.work/php/8.3/mongodb.tutorial.library.html
PREV
1
NEXT