« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 20 for insertOne (0.002 sec.)
MongoDB\Driver\BulkWriteCommand::insertOne — Add an insertOne operation | PHP 8... 13510
MongoDB\Driver\BulkWriteCommand::insertOne (mongodb >=2.1.0) MongoDB\Driver\BulkWriteCommand::insertOne — Add an insertOne operation 説明 public function MongoDB\Driver\BulkWriteCommand::insertOne ( string $namespace , array | object $docum ... ent ): mixed Add an insertOne operation to the MongoDB\Driver\BulkWriteCommand . The document will be inserted into the collection identified by namespa ... rows MongoDB\Driver\Exception\InvalidArgumentException on argument parsing errors. 例 例1 MongoDB\Driver\BulkWriteCommand::insertOne() example <?php $manager = new MongoDB\Driver\Manager ; $bulk = new MongoDB\Driver\BulkWriteCommand ; $doc1 = [ 'x' => 1 ] ... id' , 'x' => 2 ]; $doc3 = [ '_id' => new MongoDB\BSON\ObjectId ( '0123456789abcdef01234567' ), 'x' => 3 ]; $id1 = $bulk -> insertOne ( 'db.coll' , $doc1 ); $id2 = $bulk -> insertOne ( 'db.coll' , $doc2 ); $id3 = $bulk -> insertOne ( 'db.coll' , $doc3 ); v ...
https://man.mtool.work/php/8.3/mongodb-driver-bulkwritecommand.insertone.html
The MongoDB\Driver\BulkWriteCommand class | PHP 8.3 11861
The MongoDB\Driver\BulkWriteCommand class (mongodb >=2.1.0) はじめに MongoDB\Driver\BulkWriteCommand collects one or more write operations that should be sent to the server using the » bulkWrite command introduced in MongoDB 8.0. After addi ... d public function deleteOne ( string $namespace , array | object $filter , ? array $options = null ): void public function insertOne ( string $namespace , array | object $document ): mixed public function replaceOne ( string $namespace , array | object $f ... teMany ( 'db.coll_one' , []); $bulk -> deleteMany ( 'db.coll_two' , []); // Insert documents into two collections $bulk -> insertOne ( 'db.coll_one' , [ '_id' => 1 ]); $bulk -> insertOne ( 'db.coll_two' , [ '_id' => 2 ]); $bulk -> insertOne ( 'db.coll_two ... new MongoDB\Driver\Manager ; $bulk = new MongoDB\Driver\BulkWriteCommand ; $bulk -> deleteMany ( 'db.coll' , []); $bulk -> insertOne ( 'db.coll' , [ '_id' => 1 ]); $bulk -> insertOne ( 'db.coll' , [ '_id' => 2 ]); $bulk -> insertOne ( 'db.coll' , [ '_id' ...
https://man.mtool.work/php/8.3/class.mongodb-driver-bulkwritecommand.html
MongoDB\Driver\Manager::executeBulkWriteCommand — Execute write operations usin... 10434
MongoDB\Driver\Manager::executeBulkWriteCommand (mongodb >=2.1.0) MongoDB\Driver\Manager::executeBulkWriteCommand — Execute write operations using the bulkWrite command 説明 final public function MongoDB\Driver\Manager::executeBulkWriteComm ... teMany ( 'db.coll_one' , []); $bulk -> deleteMany ( 'db.coll_two' , []); // Insert documents into two collections $bulk -> insertOne ( 'db.coll_one' , [ '_id' => 1 ]); $bulk -> insertOne ( 'db.coll_two' , [ '_id' => 2 ]); $bulk -> insertOne ( 'db.coll_two ... new MongoDB\Driver\Manager ; $bulk = new MongoDB\Driver\BulkWriteCommand ; $bulk -> deleteMany ( 'db.coll' , []); $bulk -> insertOne ( 'db.coll' , [ '_id' => 1 ]); $bulk -> insertOne ( 'db.coll' , [ '_id' => 2 ]); $bulk -> insertOne ( 'db.coll' , [ '_id' ... => 1 ]); $bulk -> insertOne ( 'db.coll' , [ '_id' => 3 ]); try { $result = $manager -> executeBulkWriteCommand ( $bulk ); } catch ( MongoDB\Driver\Exc ...
https://man.mtool.work/php/8.3/mongodb-driver-manager.executebulkwritecommand.ht...
MongoDB\Driver\Exception\BulkWriteCommandException::getPartialResult — Returns ... 9635
MongoDB\Driver\Exception\BulkWriteCommandException::getPartialResult (mongodb >=2.1.0) MongoDB\Driver\Exception\BulkWriteCommandException::getPartialResult — Returns the result of any successful write operations 説明 final public function M ... new MongoDB\Driver\Manager ; $bulk = new MongoDB\Driver\BulkWriteCommand ; $bulk -> deleteMany ( 'db.coll' , []); $bulk -> insertOne ( 'db.coll' , [ '_id' => 1 ]); $bulk -> insertOne ( 'db.coll' , [ '_id' => 1 ]); try { $result = $manager -> executeBulkWr ... new MongoDB\Driver\Manager ; $bulk = new MongoDB\Driver\BulkWriteCommand ; $bulk -> deleteMany ( 'db.coll' , []); $bulk -> insertOne ( 'db.coll' , [ '_id' => 1 ]); $manager -> executeBulkWriteCommand ( $bulk ); $bulk = new MongoDB\Driver\BulkWriteCommand ... ; $bulk -> insertOne ( 'db.coll' , [ '_id' => 1 ]); try { $result = $manager -> executeBulkWriteCommand ( $bulk ); } catch ( MongoDB\Driver\Exc ...
https://man.mtool.work/php/8.3/mongodb-driver-bulkwritecommandexception.getparti...
MongoDB\Driver\BulkWriteCommandResult::getInsertResults — Returns verbose resul... 9431
MongoDB\Driver\BulkWriteCommandResult::getInsertResults (mongodb >=2.1.0) MongoDB\Driver\BulkWriteCommandResult::getInsertResults — Returns verbose results for successful inserts 説明 final public function MongoDB\Driver\BulkWriteCommandRes ... xplicitly provided, the value of insertedId in each result will match the return value of MongoDB\Driver\BulkWriteCommand::insertOne() for the corresponding insert operation. パラメータ この関数にはパラメータはありません。 戻り値 Returns a document contai ... ngoDB\Driver\Manager ; $bulk = new MongoDB\Driver\BulkWriteCommand ([ 'verboseResults' => true ]); $generatedId = $bulk -> insertOne ( 'db.coll' , [ 'x' => 1 ]); $bulk -> updateOne ( 'db.coll' , [ 'x' => 1 ], [ '$set' => [ 'y' => 3 ]]); $bulk -> updateOne ... ver\BulkWriteCommandResult::isAcknowledged() - Returns whether the write was acknowledged MongoDB\Driver\BulkWriteCommand::insertOne() - Add an insertOne operation ...
https://man.mtool.work/php/8.3/mongodb-driver-bulkwritecommandresult.getinsertre...
MongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrors — Returns an... 8853
MongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrors (mongodb >=2.1.0) MongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrors — Returns any write errors 説明 final public function MongoDB\Driver\Exception\BulkWrite ... er ; $bulk = new MongoDB\Driver\BulkWriteCommand ([ 'ordered' => false ]); $bulk -> deleteMany ( 'db.coll' , []); $bulk -> insertOne ( 'db.coll' , [ '_id' => 1 ]); $bulk -> insertOne ( 'db.coll' , [ '_id' => 1 ]); $bulk -> insertOne ( 'db.coll' , [ '_id' ...
https://man.mtool.work/php/8.3/mongodb-driver-bulkwritecommandexception.getwrite...
MongoDB\Driver\BulkWriteCommand::__construct — Create a new BulkWriteCommand | ... 8564
MongoDB\Driver\BulkWriteCommand::__construct (mongodb >=2.1.0) MongoDB\Driver\BulkWriteCommand::__construct — Create a new BulkWriteCommand 説明 public function MongoDB\Driver\BulkWriteCommand::__construct ( ? array $options = null ) Constr ... teMany ( 'db.coll_one' , []); $bulk -> deleteMany ( 'db.coll_two' , []); // Insert documents into two collections $bulk -> insertOne ( 'db.coll_one' , [ '_id' => 1 ]); $bulk -> insertOne ( 'db.coll_two' , [ '_id' => 2 ]); $bulk -> insertOne ( 'db.coll_two ...
https://man.mtool.work/php/8.3/mongodb-driver-bulkwritecommand.construct.html
MongoDB\Driver\BulkWriteCommand::count — Count number of write operations in th... 8360
MongoDB\Driver\BulkWriteCommand::count (mongodb >=2.1.0) MongoDB\Driver\BulkWriteCommand::count — Count number of write operations in the BulkWriteCommand 説明 public function MongoDB\Driver\BulkWriteCommand::count (): int Returns the numbe ... rors. 例 例1 MongoDB\Driver\BulkWriteCommand::count() example <?php $bulk = new MongoDB\Driver\BulkWriteCommand ; $bulk -> insertOne ( 'db.coll' , [ '_id' => 1 , 'x' => 1 ]); $bulk -> insertOne ( 'db.coll' , [ '_id' => 2 , 'x' => 2 ]); $bulk -> updateOne ...
https://man.mtool.work/php/8.3/mongodb-driver-bulkwritecommand.count.html
MongoDB\Driver\BulkWriteCommandResult::isAcknowledged — Returns whether the wri... 8292
MongoDB\Driver\BulkWriteCommandResult::isAcknowledged (mongodb >=2.1.0) MongoDB\Driver\BulkWriteCommandResult::isAcknowledged — Returns whether the write was acknowledged 説明 final public function MongoDB\Driver\BulkWriteCommandResult::isA ... wledged write concern <?php $manager = new MongoDB\Driver\Manager ; $bulk = new MongoDB\Driver\BulkWriteCommand ; $bulk -> insertOne ( 'db.coll' , [ 'x' => 1 ]); $result = $manager -> executeBulkWriteCommand ( $bulk ); var_dump ( $result -> isAcknowledged ... php $manager = new MongoDB\Driver\Manager ; $bulk = new MongoDB\Driver\BulkWriteCommand ([ 'ordered' => false ]); $bulk -> insertOne ( 'db.coll' , [ 'x' => 1 ]); $writeConcern = new MongoDB\Driver\WriteConcern ( 0 ); $result = $manager -> executeBulkWrite ...
https://man.mtool.work/php/8.3/mongodb-driver-bulkwritecommandresult.isacknowled...
Using the PHP Library for MongoDB (PHPLIB) | PHP 8.3 7851
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 ... nt = new MongoDB\Client ( "mongodb://localhost:27017" ); $collection = $client -> demo -> beers ; $result = $collection -> insertOne ( [ 'name' => 'Hinterland' , 'brewery' => 'BrewDog' ] ); echo "Inserted with Object ID ' { $result -> getInsertedId ()} '" ... d for the server to use as the _id . This value is also made available to the caller via the result object returned by the insertOne method. After insertion, you can query for the data that you have just inserted. For that, you use the find method, which ...
https://man.mtool.work/php/8.3/mongodb.tutorial.library.html
PREV 1 2 NEXT