+
+
+ &ini.descriptions.title;
+
+
+
+
+
+ mongodb.debug
+ string
+
+
+
+ このオプションは、拡張モジュール (および libmongoc) のトレースレベルのデバッグログを有効または無効にするために使用できます。
+
+
+ 空の文字列、 "0",
+ "off", "no", or
+ "false" を指定するとログが無効になります。
+
+
+ Specify "stderr" or "stdout" を指定すると、それぞれ stderr または stdout にログ出力します。
+
+
+ Specify "1", "on",
+ "yes", or "true" を指定すると、デフォルトのシステム一時ディレクトリ (sys_get_temp_dir) 内の新しい一時ファイルにログ出力します。
+
+
+ その他の文字列を指定すると、そのディレクトリ内の新しい一時ファイルにログ出力します。ディレクトリが使用できない場合は、デフォルトのシステム一時ディレクトリが代わりに使用されます。
+
+
+
+ デバッグログには、MongoDB サーバーへの認証情報やサーバーに書き込まれた/読み取られた完全なドキュメントなどの機密情報が含まれる可能性があることに注意してください。デバッグログを他の人と共有する前に、必ず内容を確認してください。
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb.xml b/reference/mongodb/mongodb.xml
new file mode 100644
index 0000000000..3abacb626c
--- /dev/null
+++ b/reference/mongodb/mongodb.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+ MongoDB 拡張モジュールクラス
+ MongoDB\Driver
+
+ &reference.mongodb.mongodb.driver.manager;
+ &reference.mongodb.mongodb.driver.command;
+ &reference.mongodb.mongodb.driver.query;
+ &reference.mongodb.mongodb.driver.bulkwrite;
+ &reference.mongodb.mongodb.driver.bulkwritecommand;
+ &reference.mongodb.mongodb.driver.session;
+ &reference.mongodb.mongodb.driver.clientencryption;
+ &reference.mongodb.mongodb.driver.serverapi;
+
+ &reference.mongodb.mongodb.driver.writeconcern;
+ &reference.mongodb.mongodb.driver.readpreference;
+ &reference.mongodb.mongodb.driver.readconcern;
+
+ &reference.mongodb.mongodb.driver.cursor;
+ &reference.mongodb.mongodb.driver.cursorid;
+ &reference.mongodb.mongodb.driver.cursorinterface;
+
+ &reference.mongodb.mongodb.driver.server;
+ &reference.mongodb.mongodb.driver.serverdescription;
+ &reference.mongodb.mongodb.driver.topologydescription;
+
+ &reference.mongodb.mongodb.driver.writeconcernerror;
+ &reference.mongodb.mongodb.driver.writeerror;
+ &reference.mongodb.mongodb.driver.writeresult;
+ &reference.mongodb.mongodb.driver.bulkwritecommandresult;
+
diff --git a/reference/mongodb/mongodb/driver/bulkwrite.xml b/reference/mongodb/mongodb/driver/bulkwrite.xml
new file mode 100644
index 0000000000..b6940fa24f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwrite.xml
@@ -0,0 +1,226 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWrite クラス
+ MongoDB\Driver\BulkWrite
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\BulkWrite collects one or more
+ write operations that should be sent to the server. After adding any
+ number of insert, update, and delete operations, the collection may be
+ executed via
+ MongoDB\Driver\Manager::executeBulkWrite.
+
+
+ Write operations may either be ordered (default) or unordered. Ordered write
+ operations are sent to the server, in the order provided, for serial
+ execution. If a write fails, any remaining operations will be aborted.
+ Unordered operations are sent to the server in an arbitrary order
+ where they may be executed in parallel. Any errors that occur are reported
+ after all operations have been attempted.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\BulkWrite
+
+
+
+ final
+
+ MongoDB\Driver\BulkWrite
+
+
+
+ Countable
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ Mixed write operations are grouped by type
+
+ Mixed write operations (i.e. inserts, updates, and deletes) will be
+ assembled into typed write commands to be sent sequentially to the server.
+
+
+ true]);
+$bulk->insert(['_id' => 1, 'x' => 1]);
+$bulk->insert(['_id' => 2, 'x' => 2]);
+$bulk->update(['x' => 2], ['$set' => ['x' => 1]]);
+$bulk->insert(['_id' => 3, 'x' => 3]);
+$bulk->delete(['x' => 1]);
+
+?>
+]]>
+
+
+ Will result in four write commands (i.e. roundtrips) being executed. Since
+ the operations are ordered, the third insertion cannot be sent until the
+ preceding update is executed.
+
+
+
+ Ordered write operations causing an error
+
+ true]);
+$bulk->delete([]);
+$bulk->insert(['_id' => 1]);
+$bulk->insert(['_id' => 2]);
+$bulk->insert(['_id' => 3, 'hello' => 'world']);
+$bulk->update(['_id' => 3], ['$set' => ['hello' => 'earth']]);
+$bulk->insert(['_id' => 4, 'hello' => 'pluto']);
+$bulk->update(['_id' => 4], ['$set' => ['hello' => 'moon']]);
+$bulk->insert(['_id' => 3]);
+$bulk->insert(['_id' => 4]);
+$bulk->insert(['_id' => 5]);
+
+$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017');
+$writeConcern = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 1000);
+
+try {
+ $result = $manager->executeBulkWrite('db.collection', $bulk, ['writeConcern' => $writeConcern]);
+} catch (MongoDB\Driver\Exception\BulkWriteException $e) {
+ $result = $e->getWriteResult();
+
+ // Check if the write concern could not be fulfilled
+ if ($writeConcernError = $result->getWriteConcernError()) {
+ printf("%s (%d): %s\n",
+ $writeConcernError->getMessage(),
+ $writeConcernError->getCode(),
+ var_export($writeConcernError->getInfo(), true)
+ );
+ }
+
+ // Check if any write operations did not complete at all
+ foreach ($result->getWriteErrors() as $writeError) {
+ printf("Operation#%d: %s (%d)\n",
+ $writeError->getIndex(),
+ $writeError->getMessage(),
+ $writeError->getCode()
+ );
+ }
+} catch (MongoDB\Driver\Exception\Exception $e) {
+ printf("Other error: %s\n", $e->getMessage());
+ exit;
+}
+
+printf("Inserted %d document(s)\n", $result->getInsertedCount());
+printf("Updated %d document(s)\n", $result->getModifiedCount());
+
+?>
+]]>
+
+
+ &example.outputs;
+
+
+
+
+ If the write concern could not be fullfilled, the example above would output
+ something like:
+
+
+ true,
+)
+Operation#7: E11000 duplicate key error index: databaseName.collectionName.$_id_ dup key: { : 3 } (11000)
+Inserted 4 document(s)
+Updated 2 document(s)
+]]>
+
+
+ If we execute the example above, but allow for unordered writes:
+
+
+ false]);
+/* ... */
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeBulkWrite
+ MongoDB\Driver\WriteResult
+ MongoDB\Driver\WriteConcern
+ MongoDB\Driver\WriteConcernError
+ MongoDB\Driver\WriteError
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.bulkwrite;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwrite/construct.xml b/reference/mongodb/mongodb/driver/bulkwrite/construct.xml
new file mode 100644
index 0000000000..5812b66674
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwrite/construct.xml
@@ -0,0 +1,236 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWrite::__construct
+ 新しい BulkWrite を作成する
+
+
+
+ &reftitle.description;
+
+ publicMongoDB\Driver\BulkWrite::__construct
+ arraynulloptions&null;
+
+
+ Constructs a new MongoDB\Driver\BulkWrite, which is a
+ mutable object to which one or more write operations may be added. The
+ write(s) may then be executed with
+ MongoDB\Driver\Manager::executeBulkWrite.
+
+
+
+
+ &reftitle.parameters;
+
+
+ options (array)
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+
+ bypassDocumentValidation
+ bool
+
+
+ If &true;, allows insert and update operations to circumvent
+ document level validation.
+
+
+ This option is available in MongoDB 3.2+ and is ignored for older
+ server versions, which do not support document level validation.
+
+
+ &false;
+
+
+ comment
+ mixed
+
+
+ An arbitrary comment to help trace the operation through the
+ database profiler, currentOp output, and logs.
+
+
+ This option is available in MongoDB 4.4+ and will result in an
+ exception at execution time if specified for an older server
+ version.
+
+
+
+ &mongodb.option.let;
+
+ ordered
+ bool
+
+ Ordered operations (&true;) are executed serially on the MongoDB
+ server, while unordered operations (&false;) are sent to the server
+ in an arbitrary order and may be executed in parallel.
+
+ &true;
+
+
+
+
+ deleteOptions
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+ &mongodb.option.collation;
+
+ hint
+ stringarrayobject
+
+
+ Index specification. Specify either the index name as a string or
+ the index key pattern. If specified, then the query system will only
+ consider plans using the hinted index.
+
+
+ This option is available in MongoDB 4.4+ and will result in an
+ exception at execution time if specified for an older server
+ version.
+
+
+
+
+ limit
+ bool
+ Delete all matching documents (&false;), or only the first matching document (&true;)
+ &false;
+
+
+
+
+ updateOptions
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+
+ arrayFilters
+ array
+
+
+ An array of filter documents that determines which array elements to
+ modify for an update operation on an array field. See
+ Specify arrayFilters for Array Update Operations
+ in the MongoDB manual for more information.
+
+
+ This option is available in MongoDB 3.6+ and will result in an
+ exception at execution time if specified for an older server
+ version.
+
+
+
+ &mongodb.option.collation;
+
+ hint
+ stringarrayobject
+
+
+ Index specification. Specify either the index name as a string or
+ the index key pattern. If specified, then the query system will only
+ consider plans using the hinted index.
+
+
+ This option is available in MongoDB 4.2+ and will result in an
+ exception at execution time if specified for an older server
+ version.
+
+
+
+
+ multi
+ bool
+
+ Update only the first matching document if &false;, or all
+ matching documents &true;. This option cannot be &true; if
+ newObj is a replacement document.
+
+ &false;
+
+
+ sort
+ arrayobject
+
+
+ Specify which document the operation updates if the query matches
+ multiple documents. The first document matched by the sort order
+ will be updated.
+
+
+ This option cannot be used if "multi" is &true;.
+
+
+ This option is available in MongoDB 8.0+ and will result in an
+ exception at execution time if specified for an older server
+ version.
+
+
+
+
+ upsert
+ bool
+
+ If filter does not match an existing document,
+ insert a single document. The document will be
+ created from newObj if it is a replacement
+ document (i.e. no update operators); otherwise, the operators in
+ newObj will be applied to
+ filter to create the new document.
+
+ &false;
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.21.0
+
+ Added the "sort" option.
+
+
+
+ PECL mongodb 1.7.0
+
+ Added the "hint" option.
+
+
+
+ PECL mongodb 1.6.0
+
+ The newObj parameter now accepts an aggregation
+ pipeline. This feature requires MongoDB 4.2+ and will result in an
+ exception at execution time if specified for an older server version.
+
+
+
+ PECL mongodb 1.5.0
+
+ Using the "arrayFilters" option will result in an
+ exception at execution time if unsupported by the server. Previously,
+ no exception would be thrown and the option may have been ignored.
+
+
+
+ PECL mongodb 1.4.0
+
+ Added the "arrayFilters" option.
+
+
+
+ PECL mongodb 1.2.0
+
+ Added the "collation" option.
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWrite::update の例
+
+update(
+ ['x' => 2],
+ ['$set' => ['y' => 3]],
+ ['multi' => false, 'upsert' => false]
+);
+
+$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017');
+$result = $manager->executeBulkWrite('db.collection', $bulk);
+
+?>
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeBulkWrite
+ MongoDB\Driver\WriteResult
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommand.xml b/reference/mongodb/mongodb/driver/bulkwritecommand.xml
new file mode 100644
index 0000000000..ff8decc431
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommand.xml
@@ -0,0 +1,203 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommand クラス
+ MongoDB\Driver\BulkWriteCommand
+
+
+
+
+
+ &reftitle.intro;
+
+ 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 adding any number of insert,
+ update, and delete operations, the command may be executed via
+ MongoDB\Driver\Manager::executeBulkWriteCommand.
+
+
+ Unlike MongoDB\Driver\BulkWrite, where all write
+ operations must target the same collection, each write operation within
+ MongoDB\Driver\BulkWriteCommand may target a
+ different collection.
+
+
+ Write operations may either be ordered (default) or unordered. Ordered write
+ operations are sent to the server, in the order provided, for serial
+ execution. If a write fails, any remaining operations will be aborted.
+ Unordered operations are sent to the server in an arbitrary order
+ where they may be executed in parallel. Any errors that occur are reported
+ after all operations have been attempted.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\BulkWriteCommand
+
+
+
+ final
+
+ MongoDB\Driver\BulkWriteCommand
+
+
+
+ Countable
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ Mixed write operations
+
+ Mixed write operations (i.e. inserts, updates, and deletes) will be sent
+ to the server using a single
+ bulkWrite
+ command.
+
+
+deleteMany('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', ['_id' => 3]);
+
+// Update a document in "coll_one"
+$bulk->updateOne('db.coll_one', ['_id' => 1], ['$set' => ['x' => 1]]);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+printf("Inserted %d document(s)\n", $result->getInsertedCount());
+printf("Updated %d document(s)\n", $result->getModifiedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ Ordered write operations causing an error
+
+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\Exception\BulkWriteCommandException $e) {
+ $result = $e->getPartialResult();
+
+ var_dump($e->getWriteErrors());
+}
+
+printf("Inserted %d document(s)\n", $result->getInsertedCount());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\Driver\WriteError)#5 (4) {
+ ["message"]=>
+ string(78) "E11000 duplicate key error collection: db.coll index: _id_ dup key: { _id: 1 }"
+ ["code"]=>
+ int(11000)
+ ["index"]=>
+ int(3)
+ ["info"]=>
+ object(stdClass)#6 (0) {
+ }
+ }
+}
+Inserted 2 document(s)
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeBulkWriteCommand
+ MongoDB\Driver\BulkWriteCommandResult
+ MongoDB\Driver\Exception\BulkWriteCommandException
+ MongoDB\Driver\WriteConcern
+ MongoDB\Driver\WriteConcernError
+ MongoDB\Driver\WriteError
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.bulkwritecommand;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommand/construct.xml b/reference/mongodb/mongodb/driver/bulkwritecommand/construct.xml
new file mode 100644
index 0000000000..851439ef33
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommand/construct.xml
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommand::__construct
+ 新しい BulkWriteCommand を作成する
+
+
+
+ &reftitle.description;
+
+ publicMongoDB\Driver\BulkWriteCommand::__construct
+ arraynulloptions&null;
+
+
+ Constructs a new MongoDB\Driver\BulkWriteCommand,
+ which may be used to perform many insert, update, and delete operations on
+ multiple collections in a single request using the
+ bulkWrite
+ command introduced in MongoDB 8.0. This differs from
+ MongoDB\Driver\BulkWrite, which is supported by all
+ server versions but limited to a single collection.
+
+
+ After all write operations have been added, this object may be executed with
+ MongoDB\Driver\Manager::executeBulkWriteCommand.
+
+
+
+
+ &reftitle.parameters;
+
+
+ options (array)
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+
+ bypassDocumentValidation
+ bool
+
+
+ If &true;, allows insert and update operations to circumvent
+ document level validation.
+
+
+ &false;
+
+
+ comment
+ mixed
+
+
+ An arbitrary comment to help trace the operation through the
+ database profiler, currentOp output, and logs.
+
+
+
+ &mongodb.option.let;
+
+ ordered
+ bool
+
+
+ Whether the operations in this bulk write should be executed in
+ the order in which they were specified. If &false;, writes will
+ continue to be executed if an individual write fails. If &true;,
+ writes will stop executing if an individual write fails.
+
+
+ &true;
+
+
+ verboseResults
+ bool
+
+
+ Whether detailed results for each successful operation should be
+ included in the returned
+ MongoDB\Driver\BulkWriteCommandResult.
+
+
+ &false;
+
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+ &mongodb.option.collation;
+
+ hint
+ stringarrayobject
+
+
+ Index specification. Specify either the index name as a string or
+ the index key pattern. If specified, then the query system will only
+ consider plans using the hinted index.
+
+
+
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+ &mongodb.option.collation;
+
+ hint
+ stringarrayobject
+
+
+ Index specification. Specify either the index name as a string or
+ the index key pattern. If specified, then the query system will only
+ consider plans using the hinted index.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommand::deleteOne の例
+
+deleteOne('db.coll', ['x' => 1]);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+?>
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommand::deleteMany
+ MongoDB\Driver\Manager::executeBulkWriteCommand
+ MongoDB\Driver\BulkWriteCommandResult
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommand/insertone.xml b/reference/mongodb/mongodb/driver/bulkwritecommand/insertone.xml
new file mode 100644
index 0000000000..0bc35d935e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommand/insertone.xml
@@ -0,0 +1,132 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommand::insertOne
+ insertOne 操作を追加する
+
+
+
+ &reftitle.description;
+
+ publicmixedMongoDB\Driver\BulkWriteCommand::insertOne
+ stringnamespace
+ arrayobjectdocument
+
+
+ Add an insertOne operation to the
+ MongoDB\Driver\BulkWriteCommand. The document will
+ be inserted into the collection identified by
+ namespace.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.namespace;
+
+ document (arrayobject)
+
+
+ A document to insert.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the _id of the inserted document. If the
+ document did not have an _id, the
+ MongoDB\BSON\ObjectId generated for the insert will
+ be returned.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommand::insertOne の例
+
+ 1];
+$doc2 = ['_id' => 'custom-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);
+
+var_dump($id1, $id2, $id3);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(24) "67f58058d1a0aa2fd80d55d0"
+}
+string(9) "custom-id"
+object(MongoDB\BSON\ObjectId)#4 (1) {
+ ["oid"]=>
+ string(24) "0123456789abcdef01234567"
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeBulkWriteCommand
+ MongoDB\Driver\BulkWriteCommandResult
+ MongoDB\BSON\ObjectId
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommand/replaceone.xml b/reference/mongodb/mongodb/driver/bulkwritecommand/replaceone.xml
new file mode 100644
index 0000000000..3026f88985
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommand/replaceone.xml
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommand::replaceOne
+ replaceOne 操作を追加する
+
+
+
+ &reftitle.description;
+
+ publicvoidMongoDB\Driver\BulkWriteCommand::replaceOne
+ stringnamespace
+ arrayobjectfilter
+ arrayobjectreplacement
+ arraynulloptions&null;
+
+
+ Add a replaceOne operation to the
+ MongoDB\Driver\BulkWriteCommand. The first document
+ matching filter in the collection identified by
+ namespace will be replaced.
+
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.namespace;
+ &mongodb.parameter.filter;
+
+ replacement (arrayobject)
+
+
+ A replacement document.
+
+
+
+
+ options
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+ &mongodb.option.collation;
+
+ hint
+ stringarrayobject
+
+
+ Index specification. Specify either the index name as a string or
+ the index key pattern. If specified, then the query system will only
+ consider plans using the hinted index.
+
+
+
+
+ sort
+ arrayobject
+
+
+ Specify which document the operation replaces if the query matches
+ multiple documents. The first document matched by the sort order
+ will be replaced.
+
+
+
+
+ upsert
+ bool
+
+ If filter does not match an existing document,
+ insert a single document. The document will be
+ created from replacement.
+
+ &false;
+
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+
+ arrayFilters
+ array
+
+
+ An array of filter documents that determines which array elements to
+ modify for an update operation on an array field. See
+ Specify arrayFilters for Array Update Operations
+ in the MongoDB manual for more information.
+
+
+
+ &mongodb.option.collation;
+
+ hint
+ stringarrayobject
+
+
+ Index specification. Specify either the index name as a string or
+ the index key pattern. If specified, then the query system will only
+ consider plans using the hinted index.
+
+
+
+
+ upsert
+ bool
+
+ If filter does not match an existing document,
+ insert a single document. The document will be
+ created by applying operators in update to any
+ field values in filter.
+
+ &false;
+
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+
+ arrayFilters
+ array
+
+
+ An array of filter documents that determines which array elements to
+ modify for an update operation on an array field. See
+ Specify arrayFilters for Array Update Operations
+ in the MongoDB manual for more information.
+
+
+
+ &mongodb.option.collation;
+
+ hint
+ stringarrayobject
+
+
+ Index specification. Specify either the index name as a string or
+ the index key pattern. If specified, then the query system will only
+ consider plans using the hinted index.
+
+
+
+
+ sort
+ arrayobject
+
+
+ Specify which document the operation updates if the query matches
+ multiple documents. The first document matched by the sort order
+ will be updated.
+
+
+
+
+ upsert
+ bool
+
+ If filter does not match an existing document,
+ insert a single document. The document will be
+ created by applying operators in update to any
+ field values in filter.
+
+ &false;
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommand::updateOne の例
+
+updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 2]]);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+?>
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommand::replaceOne
+ MongoDB\Driver\BulkWriteCommand::updateMany
+ MongoDB\Driver\Manager::executeBulkWriteCommand
+ MongoDB\Driver\BulkWriteCommandResult
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult.xml
new file mode 100644
index 0000000000..0991f53af9
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult クラス
+ MongoDB\Driver\BulkWriteCommandResult
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\BulkWriteCommandResult class
+ encapsulates information about an executed
+ MongoDB\Driver\BulkWriteCommand and is returned by
+ MongoDB\Driver\Manager::executeBulkWriteCommand.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult
+
+
+
+ final
+
+ MongoDB\Driver\BulkWriteCommandResult
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.bulkwritecommandresult;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult/getdeletedcount.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getdeletedcount.xml
new file mode 100644
index 0000000000..b5eda47b92
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getdeletedcount.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::getDeletedCount
+ number of documents deleted を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\BulkWriteCommandResult::getDeletedCount
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the total number of documents deleted by all operations.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ &mongodb.throws.unacknowledged;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommandResult::getDeletedCount の例
+
+insertOne('db.coll', ['x' => 1]);
+$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->deleteMany('db.coll', []);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+var_dump($result->getDeletedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommandResult::getDeleteResults
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult/getdeleteresults.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getdeleteresults.xml
new file mode 100644
index 0000000000..256de8e79c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getdeleteresults.xml
@@ -0,0 +1,115 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::getDeleteResults
+ 成功した削除の詳細な結果を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\DocumentnullMongoDB\Driver\BulkWriteCommandResult::getDeleteResults
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a document containing the result of each successful delete
+ operation, or &null; if verbose results were not requested. The document
+ keys will correspond to the index of the write operation from
+ MongoDB\Driver\BulkWriteCommand.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ &mongodb.throws.unacknowledged;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommandResult::getDeleteResults の例
+
+ true]);
+$bulk->insertOne('db.coll', ['x' => 1]);
+$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->deleteMany('db.coll', []);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+var_dump($result->getDeleteResults()->toPHP());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(stdClass)#6 (1) {
+ ["deletedCount"]=>
+ object(MongoDB\BSON\Int64)#5 (1) {
+ ["integer"]=>
+ string(1) "3"
+ }
+ }
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommandResult::getDeletedCount
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult/getinsertedcount.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getinsertedcount.xml
new file mode 100644
index 0000000000..601d8c57ec
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getinsertedcount.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::getInsertedCount
+ number of documents inserted を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\BulkWriteCommandResult::getInsertedCount
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the total number of documents inserted (excluding upserts) by all
+ operations.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ &mongodb.throws.unacknowledged;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommandResult::getInsertedCount の例
+
+insertOne('db.coll', ['x' => 1]);
+$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->deleteMany('db.coll', []);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+var_dump($result->getInsertedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommandResult::getInsertResults
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult/getinsertresults.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getinsertresults.xml
new file mode 100644
index 0000000000..3d915a1db0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getinsertresults.xml
@@ -0,0 +1,129 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::getInsertResults
+ 成功した挿入の詳細な結果を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\DocumentnullMongoDB\Driver\BulkWriteCommandResult::getInsertResults
+
+
+
+ Since _id fields for inserted documents are generated by
+ the extension, the value of insertedId in each result
+ will match the return value of
+ MongoDB\Driver\BulkWriteCommand::insertOne for
+ the corresponding insert operation.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a document containing the result of each successful insert
+ operation, or &null; if verbose results were not requested. The document
+ keys will correspond to the index of the write operation from
+ MongoDB\Driver\BulkWriteCommand.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ &mongodb.throws.unacknowledged;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommandResult::getInsertResults の例
+
+ true]);
+
+$generatedId = $bulk->insertOne('db.coll', ['x' => 1]);
+
+$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->deleteMany('db.coll', []);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+var_dump($generatedId);
+
+var_dump($result->getInsertResults()->toPHP());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(24) "67f7ee69783dcce702097b41"
+}
+object(stdClass)#8 (1) {
+ ["0"]=>
+ object(stdClass)#7 (1) {
+ ["insertedId"]=>
+ object(MongoDB\BSON\ObjectId)#6 (1) {
+ ["oid"]=>
+ string(24) "67f7ee69783dcce702097b41"
+ }
+ }
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommandResult::getInsertedCount
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+ MongoDB\Driver\BulkWriteCommand::insertOne
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult/getmatchedcount.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getmatchedcount.xml
new file mode 100644
index 0000000000..cb90ab368e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getmatchedcount.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::getMatchedCount
+ number of documents selected for update を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\BulkWriteCommandResult::getMatchedCount
+
+
+
+ If the update operation results in no change to the document (e.g. setting
+ the value of a field to its current value), the matched count may be greater
+ than the value returned by
+ MongoDB\Driver\BulkWriteCommandResult::getModifiedCount.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the total number of documents selected for update by all operations.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ &mongodb.throws.unacknowledged;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommandResult::getMatchedCount の例
+
+insertOne('db.coll', ['x' => 1]);
+$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->deleteMany('db.coll', []);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+var_dump($result->getMatchedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommandResult::getModifiedCount
+ MongoDB\Driver\BulkWriteCommandResult::getUpdateResults
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult/getmodifiedcount.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getmodifiedcount.xml
new file mode 100644
index 0000000000..66e8476d78
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getmodifiedcount.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::getModifiedCount
+ number of existing documents updated を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\BulkWriteCommandResult::getModifiedCount
+
+
+
+ If the update operation results in no change to the document (e.g. setting
+ the value of a field to its current value), the modified count may be less
+ than the value returned by
+ MongoDB\Driver\BulkWriteCommandResult::getMatchedCount.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the total number of existing documents updated by all operations.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ &mongodb.throws.unacknowledged;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommandResult::getModifiedCount の例
+
+insertOne('db.coll', ['x' => 1]);
+$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->deleteMany('db.coll', []);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+var_dump($result->getModifiedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommandResult::getMatchedCount
+ MongoDB\Driver\BulkWriteCommandResult::getUpdateResults
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult/getupdateresults.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getupdateresults.xml
new file mode 100644
index 0000000000..a6ad7f2b6d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getupdateresults.xml
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::getUpdateResults
+ 成功した更新の詳細な結果を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\DocumentnullMongoDB\Driver\BulkWriteCommandResult::getUpdateResults
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a document containing the result of each successful update
+ operation, or &null; if verbose results were not requested. The document
+ keys will correspond to the index of the write operation from
+ MongoDB\Driver\BulkWriteCommand.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ &mongodb.throws.unacknowledged;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommandResult::getUpdateResults の例
+
+ true]);
+$bulk->insertOne('db.coll', ['x' => 1]);
+$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->deleteMany('db.coll', []);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+var_dump($result->getUpdateResults()->toPHP());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(stdClass)#7 (2) {
+ ["matchedCount"]=>
+ object(MongoDB\BSON\Int64)#5 (1) {
+ ["integer"]=>
+ string(1) "1"
+ }
+ ["modifiedCount"]=>
+ object(MongoDB\BSON\Int64)#6 (1) {
+ ["integer"]=>
+ string(1) "1"
+ }
+ }
+ ["2"]=>
+ object(stdClass)#11 (3) {
+ ["matchedCount"]=>
+ object(MongoDB\BSON\Int64)#8 (1) {
+ ["integer"]=>
+ string(1) "1"
+ }
+ ["modifiedCount"]=>
+ object(MongoDB\BSON\Int64)#9 (1) {
+ ["integer"]=>
+ string(1) "0"
+ }
+ ["upsertedId"]=>
+ object(MongoDB\BSON\ObjectId)#10 (1) {
+ ["oid"]=>
+ string(24) "67f7eb9b1f198bbcb880d575"
+ }
+ }
+ ["3"]=>
+ object(stdClass)#15 (3) {
+ ["matchedCount"]=>
+ object(MongoDB\BSON\Int64)#12 (1) {
+ ["integer"]=>
+ string(1) "1"
+ }
+ ["modifiedCount"]=>
+ object(MongoDB\BSON\Int64)#13 (1) {
+ ["integer"]=>
+ string(1) "0"
+ }
+ ["upsertedId"]=>
+ object(MongoDB\BSON\ObjectId)#14 (1) {
+ ["oid"]=>
+ string(24) "67f7eb9b1f198bbcb880d576"
+ }
+ }
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommandResult::getMatchedCount
+ MongoDB\Driver\BulkWriteCommandResult::getModifiedCount
+ MongoDB\Driver\BulkWriteCommandResult::getUpsertedCount
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult/getupsertedcount.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getupsertedcount.xml
new file mode 100644
index 0000000000..595e1392ce
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult/getupsertedcount.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::getUpsertedCount
+ number of documents upserted を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\BulkWriteCommandResult::getUpsertedCount
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the total number of documents upserted by all operations.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ &mongodb.throws.unacknowledged;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommandResult::getUpsertedCount の例
+
+insertOne('db.coll', ['x' => 1]);
+$bulk->updateOne('db.coll', ['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->updateOne('db.coll', ['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->deleteMany('db.coll', []);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+var_dump($result->getUpsertedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommandResult::getUpdateResults
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/bulkwritecommandresult/isacknowledged.xml b/reference/mongodb/mongodb/driver/bulkwritecommandresult/isacknowledged.xml
new file mode 100644
index 0000000000..eddec7ccae
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/bulkwritecommandresult/isacknowledged.xml
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+ the write was acknowledged かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\BulkWriteCommandResult::isAcknowledged
+
+
+
+ If the write is acknowledged, other fields will be available on the
+ MongoDB\Driver\BulkWriteCommandResult object.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if the write was acknowledged, and &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged with acknowledged write concern
+
+insertOne('db.coll', ['x' => 1]);
+
+$result = $manager->executeBulkWriteCommand($bulk);
+
+var_dump($result->isAcknowledged());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ MongoDB\Driver\BulkWriteCommandResult::isAcknowledged with unacknowledged write concern
+
+ false]);
+$bulk->insertOne('db.coll', ['x' => 1]);
+
+$writeConcern = new MongoDB\Driver\WriteConcern(0);
+
+$result = $manager->executeBulkWriteCommand($bulk, ['writeConcern' => $writeConcern]);
+
+var_dump($result->isAcknowledged());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteConcern
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption.xml b/reference/mongodb/mongodb/driver/clientencryption.xml
new file mode 100644
index 0000000000..0d27c0a407
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption.xml
@@ -0,0 +1,257 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption クラス
+ MongoDB\Driver\ClientEncryption
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\ClientEncryption class handles
+ creation of data keys for client-side encryption, as well as manually
+ encrypting and decrypting values.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\ClientEncryption
+
+
+
+ final
+
+ MongoDB\Driver\ClientEncryption
+
+
+
+
+
+ &Constants;
+
+ const
+ string
+ MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC
+ AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic
+
+
+ const
+ string
+ MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM
+ AEAD_AES_256_CBC_HMAC_SHA_512-Random
+
+
+ const
+ string
+ MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED
+ Indexed
+
+
+ const
+ string
+ MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED
+ Unindexed
+
+
+ const
+ string
+ MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE
+ Range
+
+
+ const
+ string
+ MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY
+ equality
+
+
+ const
+ string
+ MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE
+ range
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+
+ MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_DETERMINISTIC
+
+ Specifies an algorithm for deterministic encryption, which is suitable for querying.
+
+
+
+
+ MongoDB\Driver\ClientEncryption::AEAD_AES_256_CBC_HMAC_SHA_512_RANDOM
+
+ Specifies an algorithm for randomized encryption
+
+
+
+
+ MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED
+
+ Specifies an algorithm for an indexed, encrypted payload, which can be used with queryable encryption.
+ To insert or query with an indexed, encrypted payload, the MongoDB\Driver\Manager must be configured with the "autoEncryption" driver option. The "bypassQueryAnalysis" auto encryption option may be &true;. The "bypassAutoEncryption" auto encryption option must be &false;.
+
+
+
+
+ MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED
+
+ Specifies an algorithm for an unindexed, encrypted payload.
+
+
+
+
+ MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE
+
+
+ Specifies an algorithm for a range encrypted payload, which can be used
+ with queryable encryption.
+
+
+ To query with a range encrypted payload, the
+ MongoDB\Driver\Manager must be configured with the
+ "autoEncryption" driver option. The
+ "bypassQueryAnalysis" auto encryption option may be
+ &true;. The "bypassAutoEncryption" auto encryption
+ option must be &false;.
+
+
+ The extension does not yet support range queries for Decimal128 BSON field types.
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY
+
+
+ Specifies an equality query type, which is used in conjunction with
+ MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED.
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE
+
+
+ Specifies a range query type, which is used in conjunction with
+ MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE.
+
+
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+
+ Removed MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW
+ and MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW.
+
+
+
+
+ PECL mongodb 1.20.0
+
+
+ Added MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE
+ and MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE.
+
+
+ Deprecated MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW
+ and MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW.
+
+
+
+
+ PECL mongodb 1.16.0
+
+ Added MongoDB\Driver\ClientEncryption::ALGORITHM_RANGE_PREVIEW
+ and MongoDB\Driver\ClientEncryption::QUERY_TYPE_RANGE_PREVIEW.
+
+
+
+ PECL mongodb 1.14.0
+
+ Added MongoDB\Driver\ClientEncryption::ALGORITHM_INDEXED,
+ MongoDB\Driver\ClientEncryption::ALGORITHM_UNINDEXED,
+ and MongoDB\Driver\ClientEncryption::QUERY_TYPE_EQUALITY.
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::createClientEncryption
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.clientencryption;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/addkeyaltname.xml b/reference/mongodb/mongodb/driver/clientencryption/addkeyaltname.xml
new file mode 100644
index 0000000000..a43d60edd6
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/addkeyaltname.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::addKeyAltName
+ キードキュメントに代替名を追加する
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectnullMongoDB\Driver\ClientEncryption::addKeyAltName
+ MongoDB\BSON\BinarykeyId
+ stringkeyAltName
+
+
+ Adds keyAltName to the set of alternate names for the
+ key document with the given UUID keyId.
+
+
+
+
+ &reftitle.parameters;
+
+
+ keyId
+
+
+ A MongoDB\BSON\Binary instance with subtype 4
+ (UUID) identifying the key document.
+
+
+
+
+
+ keyAltName
+
+
+ Alternate name to add to the key document.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the previous version of the key document, or &null; if no document
+ matched.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ClientEncryption::getKeyByAltName
+ MongoDB\Driver\ClientEncryption::removeKeyAltName
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/construct.xml b/reference/mongodb/mongodb/driver/clientencryption/construct.xml
new file mode 100644
index 0000000000..f3fe179005
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/construct.xml
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::__construct
+ 新しい ClientEncryption object を作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ClientEncryption::__construct
+ arrayoptions
+
+
+ Constructs a new MongoDB\Driver\ClientEncryption object with the specified options.
+
+
+
+
+ &reftitle.parameters;
+
+
+ options
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+
+
+
+
+ keyVaultClient
+ MongoDB\Driver\Manager
+ The Manager used to route data key queries. This option is required (unlike with MongoDB\Driver\Manager::createClientEncryption).
+
+ &mongodb.option.encryption.keyVaultNamespace;
+ &mongodb.option.encryption.kmsProviders;
+ &mongodb.option.encryption.tlsOptions;
+
+
+
+
+
+
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\RuntimeException if the extension was compiled without libmongocrypt support
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.16.0
+
+
+ The AWS KMS provider for client-side encryption now accepts a
+ "sessionToken" option, which can be used to
+ authenticate with temporary AWS credentials.
+
+
+ Added "tlsDisableOCSPEndpointCheck" to the
+ "tlsOptions" option.
+
+
+ If an empty document is specified for the "azure" or
+ "gcp" KMS provider, the driver will attempt to
+ configure the provider using
+ Automatic Credentials.
+
+
+
+
+ PECL mongodb 1.15.0
+
+
+ If an empty document is specified for the "aws" KMS
+ provider, the driver will attempt to configure the provider using
+ Automatic Credentials.
+
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::createClientEncryption
+ Explicit (Manual) Client-Side Field Level Encryption in the MongoDB manual
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/createdatakey.xml b/reference/mongodb/mongodb/driver/clientencryption/createdatakey.xml
new file mode 100644
index 0000000000..3b6a78c4fe
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/createdatakey.xml
@@ -0,0 +1,171 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::createDataKey
+ キードキュメントを作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\BinaryMongoDB\Driver\ClientEncryption::createDataKey
+ stringkmsProvider
+ arraynulloptions&null;
+
+
+ Creates a new key document and inserts it into the key vault collection.
+
+
+
+
+ &reftitle.parameters;
+
+
+ kmsProvider
+
+
+ The KMS provider (e.g. "local",
+ "aws") that will be used to encrypt the new data key.
+
+
+
+
+
+ options
+
+
+
+ Data key options
+
+
+
+ Option
+ Type
+ Description
+
+
+
+
+ masterKey
+ array
+
+
+ The masterKey document identifies a KMS-specific key used to encrypt
+ the new data key. This option is required unless
+ kmsProvider is "local".
+
+ &mongodb.option.encryption.masterKey-options-by-provider;
+
+
+
+ keyAltNames
+ array
+
+
+ An optional list of string alternate names used to reference a key.
+ If a key is created with alternate names, then encryption may refer
+ to the key by the unique alternate name instead of by
+ _id.
+
+
+
+
+ keyMaterial
+ MongoDB\BSON\Binary
+
+
+ An optional 96-byte value to use as custom key material for the data
+ key being created. If keyMaterial is given, the custom key material
+ is used for encrypting and decrypting data. Otherwise, the key
+ material for the new data key is generated from a cryptographically
+ secure random device.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the identifier of the new key as a
+ MongoDB\BSON\Binary object with subtype 4 (UUID).
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.20.0
+
+ Added "delegated" to the KMIP provider masterKey options.
+
+
+
+ PECL mongodb 1.15.0
+
+ Added the "keyMaterial" option.
+
+
+
+ PECL mongodb 1.10.0
+
+ Azure and GCP are now supported as KMS providers for client-side
+ encryption.
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/decrypt.xml b/reference/mongodb/mongodb/driver/clientencryption/decrypt.xml
new file mode 100644
index 0000000000..1b7457ef80
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/decrypt.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::decrypt
+ 値を復号する
+
+
+
+ &reftitle.description;
+
+ finalpublicmixedMongoDB\Driver\ClientEncryption::decrypt
+ MongoDB\BSON\Binaryvalue
+
+
+ Decrypts the value.
+
+
+
+
+ &reftitle.parameters;
+
+
+ value
+
+
+ A MongoDB\BSON\Binary instance with subtype 6
+ containing the encrypted value.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the decrypted value as it was passed to
+ MongoDB\Driver\ClientEncryption::encrypt.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\EncryptionException if an error occurs while decrypting the value
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ClientEncryption::encrypt
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/deletekey.xml b/reference/mongodb/mongodb/driver/clientencryption/deletekey.xml
new file mode 100644
index 0000000000..0a75691dae
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/deletekey.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::deleteKey
+ キードキュメントを削除する
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectMongoDB\Driver\ClientEncryption::deleteKey
+ MongoDB\BSON\BinarykeyId
+
+
+ Removes the key document with the given UUID keyId
+ from the key vault collection.
+
+
+
+
+ &reftitle.parameters;
+
+
+ keyId
+
+
+ A MongoDB\BSON\Binary instance with subtype 4
+ (UUID) identifying the key document.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the result of the internal deleteOne operation on
+ the key vault collection.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/encrypt.xml b/reference/mongodb/mongodb/driver/clientencryption/encrypt.xml
new file mode 100644
index 0000000000..9469d60839
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/encrypt.xml
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::encrypt
+ 値を暗号化する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\BinaryMongoDB\Driver\ClientEncryption::encrypt
+ mixedvalue
+ arraynulloptions&null;
+
+
+ Encrypts the value.
+
+
+
+
+ &reftitle.parameters;
+
+
+ value
+
+
+ The value to be encrypted. Any value that can be inserted into MongoDB can
+ be encrypted using this method.
+
+
+
+ &mongodb.parameter.encryptOpts;
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the encrypted value as
+ MongoDB\BSON\Binary object with subtype 6.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\EncryptionException if an error occurs while encrypting the value
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.20.0
+
+ Added the "trimFactor" range option. The
+ "sparsity" range option is now optional.
+
+
+
+ PECL mongodb 1.16.0
+
+ Added the "rangeOpts" option.
+
+
+
+ PECL mongodb 1.14.0
+
+ Added the "contentionFactor" and
+ "queryType" options.
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ClientEncryption::decrypt
+ MongoDB\Driver\ClientEncryption::encryptExpression
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/encryptexpression.xml b/reference/mongodb/mongodb/driver/clientencryption/encryptexpression.xml
new file mode 100644
index 0000000000..1e72e3a3a8
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/encryptexpression.xml
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::encryptExpression
+ マッチ式または集約式を暗号化する
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectMongoDB\Driver\ClientEncryption::encryptExpression
+ arrayobjectexpr
+ arraynulloptions&null;
+
+
+ Encrypts a match or aggregate expression to query a range index.
+
+ To query with a range encrypted payload, the MongoDB\Driver\Manager must be configured with the "autoEncryption" driver option. The "bypassQueryAnalysis" auto encryption option may be &true;. The "bypassAutoEncryption" auto encryption option must be &false;.
+
+ The extension does not yet support range queries for Decimal128 BSON field types.
+
+
+
+
+ &reftitle.parameters;
+
+
+ expr
+
+
+ The match or aggregate expression to be encrypted. Expressions must use at
+ least one of the $gt, $gte,
+ $lt, or $lte operators. A top-level
+ $and operator is required, even if only a single
+ comparison operator is used.
+
+
+ An example of a supported match expression (applies to queries and the
+ $match aggregation stage) is as follows:
+
+
+ [
+ [ '' => [ '$gt' => '' ] ],
+ [ '' => [ '$lte' => '' ] ],
+ ],
+]
+]]>
+
+
+ An example of a supported aggregate expression is as follows:
+
+
+ [
+ [ '$gte' => [ '', '' ] ],
+ [ '$lt' => [ '', '' ] ],
+ ],
+]
+]]>
+
+
+
+ &mongodb.parameter.encryptOpts;
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the encrypted expression as an object.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\EncryptionException if an error occurs while encrypting the expression
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.20.0
+
+ Added the "trimFactor" range option. The
+ "sparsity" range option is now optional.
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::__construct
+ MongoDB\Driver\ClientEncryption::encrypt
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/getkey.xml b/reference/mongodb/mongodb/driver/clientencryption/getkey.xml
new file mode 100644
index 0000000000..c58c32edc9
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/getkey.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::getKey
+ キードキュメントを取得する
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectnullMongoDB\Driver\ClientEncryption::getKey
+ MongoDB\BSON\BinarykeyId
+
+
+ Finds a single key document in the key vault collection with the given UUID
+ keyId.
+
+
+
+
+ &reftitle.parameters;
+
+
+ keyId
+
+
+ A MongoDB\BSON\Binary instance with subtype 4
+ (UUID) identifying the key document.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the key document, or &null; if no document matched.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/getkeybyaltname.xml b/reference/mongodb/mongodb/driver/clientencryption/getkeybyaltname.xml
new file mode 100644
index 0000000000..45364cf35f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/getkeybyaltname.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::getKeyByAltName
+ 代替名でキードキュメントを取得する
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectnullMongoDB\Driver\ClientEncryption::getKeyByAltName
+ stringkeyAltName
+
+
+ Finds a single key document in the key vault collection with the given
+ alternate name keyAltName.
+
+
+
+
+ &reftitle.parameters;
+
+
+ keyAltName
+
+
+ Alternate name for the key document.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the key document, or &null; if no document matched.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ClientEncryption::addKeyAltName
+ MongoDB\Driver\ClientEncryption::removeKeyAltName
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/getkeys.xml b/reference/mongodb/mongodb/driver/clientencryption/getkeys.xml
new file mode 100644
index 0000000000..b6b02aa89a
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/getkeys.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::getKeys
+ すべてのキードキュメントを取得する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\CursorMongoDB\Driver\ClientEncryption::getKeys
+
+
+
+ Finds all key documents in the key vault collection.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+ &mongodb.returns.cursor;
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/removekeyaltname.xml b/reference/mongodb/mongodb/driver/clientencryption/removekeyaltname.xml
new file mode 100644
index 0000000000..153d1bf07c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/removekeyaltname.xml
@@ -0,0 +1,92 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::removeKeyAltName
+ キードキュメントから代替名を削除する
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectnullMongoDB\Driver\ClientEncryption::removeKeyAltName
+ MongoDB\BSON\BinarykeyId
+ stringkeyAltName
+
+
+ Removes keyAltName from the set of alternate names for
+ the key document with the given UUID keyId.
+
+
+
+
+ &reftitle.parameters;
+
+
+ keyId
+
+
+ A MongoDB\BSON\Binary instance with subtype 4
+ (UUID) identifying the key document.
+
+
+
+
+
+ keyAltName
+
+
+ Alternate name to remove from the key document.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the previous version of the key document, or &null; if no document
+ matched.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ClientEncryption::addKeyAltName
+ MongoDB\Driver\ClientEncryption::getKeyByAltName
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/clientencryption/rewrapmanydatakey.xml b/reference/mongodb/mongodb/driver/clientencryption/rewrapmanydatakey.xml
new file mode 100644
index 0000000000..800a595011
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/clientencryption/rewrapmanydatakey.xml
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+ MongoDB\Driver\ClientEncryption::rewrapManyDataKey
+ データキーを再ラップする
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectMongoDB\Driver\ClientEncryption::rewrapManyDataKey
+ arrayobjectfilter
+ arraynulloptions&null;
+
+
+ Rewraps (i.e. decrypts and re-encrypts) zero or more data keys in the key
+ vault collection that match the given filter.
+
+
+ If the "provider" option is not specified, matching data
+ keys will be rewrapped with their current KMS provider. Otherwise, matching
+ data keys will be re-encrypted according to the specified
+ "provider" and "masterKey" options.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.filter;
+
+ options
+
+
+
+ RewrapManyDataKey options
+
+
+
+ Option
+ Type
+ Description
+
+
+
+
+ provider
+ string
+
+
+ The KMS provider (e.g. "local",
+ "aws") that will be used to re-encrypt the
+ matched data keys.
+
+
+ If a KMS provider is not specified, matched data keys will be
+ re-encrypted with their current KMS provider.
+
+
+
+
+ masterKey
+ array
+
+
+ The masterKey identifies a KMS-specific key used to encrypt the new
+ data key. This option should not be specified without the
+ "provider" option. This option is required if
+ "provider" is specified and not
+ "local".
+
+ &mongodb.option.encryption.masterKey-options-by-provider;
+
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an object, which will have an optional
+ bulkWriteResult property containing the result of the
+ internal bulkWrite operation as an object. If no data keys
+ matched the filter or the write was unacknowledged, the
+ bulkWriteResult property will be &null;.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\EncryptionException if an error occurs while decrypting or re-encrypting a data key.
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.20.0
+
+ Added "delegated" to the KMIP provider masterKey options.
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/command.xml b/reference/mongodb/mongodb/driver/command.xml
new file mode 100644
index 0000000000..98a19819bf
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/command.xml
@@ -0,0 +1,197 @@
+
+
+
+
+
+
+ MongoDB\Driver\Command クラス
+ MongoDB\Driver\Command
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Command class is a value object
+ that represents a database command.
+
+
+ To provide Command Helpers the MongoDB\Driver\Command object should be composed.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Command
+
+
+
+ final
+
+ MongoDB\Driver\Command
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ Composing MongoDB\Driver\Command to provide a helper to create collections
+
+cmd["create"] = (string) $collectionName;
+ }
+ function setCappedCollection($maxBytes, $maxDocuments = false) {
+ $this->cmd["capped"] = true;
+ $this->cmd["size"] = (int) $maxBytes;
+
+ if ($maxDocuments) {
+ $this->cmd["max"] = (int) $maxDocuments;
+ }
+ }
+ function usePowerOf2Sizes($bool) {
+ if ($bool) {
+ $this->cmd["flags"] = 1;
+ } else {
+ $this->cmd["flags"] = 0;
+ }
+ }
+ function setFlags($flags) {
+ $this->cmd["flags"] = (int) $flags;
+ }
+ function getCommand() {
+ return new MongoDB\Driver\Command($this->cmd);
+ }
+ function getCollectionName() {
+ return $this->cmd["create"];
+ }
+}
+
+
+$manager = new MongoDB\Driver\Manager("mongodb://localhost:27017");
+
+$createCollection = new CreateCollection("cappedCollection");
+$createCollection->setCappedCollection(64 * 1024);
+
+try {
+ $command = $createCollection->getCommand();
+ $cursor = $manager->executeCommand("databaseName", $command);
+ $response = $cursor->toArray()[0];
+ var_dump($response);
+
+ $collstats = ["collstats" => $createCollection->getCollectionName()];
+ $cursor = $manager->executeCommand("databaseName", new MongoDB\Driver\Command($collstats));
+ $response = $cursor->toArray()[0];
+ var_dump($response);
+} catch(MongoDB\Driver\Exception $e) {
+ echo $e->getMessage(), "\n";
+ exit;
+}
+
+?>
+]]>
+
+
+ &example.outputs;
+
+
+ array(3) {
+ ["create"]=>
+ string(16) "cappedCollection"
+ ["capped"]=>
+ bool(true)
+ ["size"]=>
+ int(65536)
+ }
+}
+array(1) {
+ ["ok"]=>
+ float(1)
+}
+array(16) {
+ ["ns"]=>
+ string(29) "databaseName.cappedCollection"
+ ["count"]=>
+ int(0)
+ ["size"]=>
+ int(0)
+ ["numExtents"]=>
+ int(1)
+ ["storageSize"]=>
+ int(65536)
+ ["nindexes"]=>
+ int(1)
+ ["lastExtentSize"]=>
+ float(65536)
+ ["paddingFactor"]=>
+ float(1)
+ ["paddingFactorNote"]=>
+ string(101) "paddingFactor is unused and unmaintained in 2.8. It remains hard coded to 1.0 for compatibility only."
+ ["userFlags"]=>
+ int(0)
+ ["capped"]=>
+ bool(true)
+ ["max"]=>
+ int(9223372036854775807)
+ ["maxSize"]=>
+ int(65536)
+ ["totalIndexSize"]=>
+ int(8176)
+ ["indexSizes"]=>
+ object(stdClass)#4 (1) {
+ ["_id_"]=>
+ int(8176)
+ }
+ ["ok"]=>
+ float(1)
+}
+]]>
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.command;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/command/construct.xml b/reference/mongodb/mongodb/driver/command/construct.xml
new file mode 100644
index 0000000000..4964bb6791
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/command/construct.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+ MongoDB\Driver\Command::__construct
+ 新しい Command を作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\Command::__construct
+ arrayobjectdocument
+ arraynullcommandOptions&null;
+
+
+ Constructs a new MongoDB\Driver\Command, which is an
+ immutable value object that represents a database command. The command may
+ then be executed with
+ MongoDB\Driver\Manager::executeCommand.
+
+
+ The complete command document, which includes the command name and its
+ options, should be expressed in the document
+ parameter. The commandOptions parameter is only used
+ to specify options related to the execution of the command and the resulting
+ MongoDB\Driver\Cursor.
+
+
+
+
+ &reftitle.parameters;
+
+
+ document
+
+
+ The complete command document, which will be sent to the server.
+
+
+
+
+
+ commandOptions
+
+
+
+ Do not use this parameter to specify options described in the command's
+ reference in the MongoDB manual. This parameter should only be used for
+ the options explicitly listed below.
+
+
+
+
+ commandOptions
+
+
+
+ Option
+ Type
+ Description
+
+
+
+
+ maxAwaitTimeMS
+ int
+
+
+ Positive integer denoting the time limit in milliseconds for the
+ server to block a getMore operation if no data is available. This
+ option should only be used in conjunction with commands that return
+ a tailable cursor (e.g. Change
+ Streams).
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.4.0
+
+
+ Added a second commandOptions argument, which supports
+ the "maxAwaitTimeMS" option.
+
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Command::__construct の例
+
+ 1));
+
+try {
+ $cursor = $manager->executeCommand("admin", $command);
+ $response = $cursor->toArray()[0];
+} catch(MongoDB\Driver\Exception $e) {
+ echo $e->getMessage(), "\n";
+ exit;
+}
+var_dump($response);
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(14) "2.8.0-rc2-pre-"
+ ["gitVersion"]=>
+ string(62) "b743d7158f7642f4da6b7eac8320374b3b88dc2e modules: subscription"
+ ["OpenSSLVersion"]=>
+ string(25) "OpenSSL 1.0.1f 6 Jan 2014"
+ ["sysInfo"]=>
+ string(104) "Linux infant 3.16.0-24-generic #32-Ubuntu SMP Tue Oct 28 13:07:32 UTC 2014 x86_64 BOOST_LIB_VERSION=1_49"
+ ["loaderFlags"]=>
+ string(91) "-fPIC -pthread -Wl,-z,now -rdynamic -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-E"
+ ["compilerFlags"]=>
+ string(301) "-Wnon-virtual-dtor -Woverloaded-virtual -std=c++11 -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -Werror -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-but-set-variable -fno-builtin-memcmp -std=c99"
+ ["allocator"]=>
+ string(8) "tcmalloc"
+ ["versionArray"]=>
+ array(4) {
+ [0]=>
+ int(2)
+ [1]=>
+ int(8)
+ [2]=>
+ int(0)
+ [3]=>
+ int(-8)
+ }
+ ["javascriptEngine"]=>
+ string(2) "V8"
+ ["bits"]=>
+ int(64)
+ ["debug"]=>
+ bool(false)
+ ["maxBsonObjectSize"]=>
+ int(16777216)
+ ["ok"]=>
+ float(1)
+}
+
+]]>
+
+
+
+
+ MongoDB\Driver\Command::__construct の例
+
+ Commands can accept options as well, as part of the normal structure that
+ you create to send to the server. For example, the
+ maxTimeMS option can be passed with most commands to
+ restrict the amount of time a specific command can run for on the server.
+
+
+ "beer",
+ "key" => "beer_name",
+ "maxTimeMS" => 10,
+ )
+);
+
+try {
+ $cursor = $manager->executeCommand("beerdb", $command);
+ $response = $cursor->toArray()[0];
+} catch(MongoDB\Driver\Exception\Exception $e) {
+ echo $e->getMessage(), "\n";
+ exit;
+}
+var_dump($response);
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+ operation exceeded time limit
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeCommand
+ MongoDB\Driver\Cursor
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor.xml b/reference/mongodb/mongodb/driver/cursor.xml
new file mode 100644
index 0000000000..eaf5cd220f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor.xml
@@ -0,0 +1,315 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor クラス
+ MongoDB\Driver\Cursor
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Cursor class encapsulates
+ the results of a MongoDB command or query and may be returned by
+ MongoDB\Driver\Manager::executeCommand or
+ MongoDB\Driver\Manager::executeQuery, respectively.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Cursor
+
+
+
+ final
+
+ MongoDB\Driver\Cursor
+
+
+
+ MongoDB\Driver\CursorInterface
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.9.0
+
+ Iterator を実装しました。
+
+
+
+ PECL mongodb 1.6.0
+
+ Implements MongoDB\Driver\CursorInterface,
+ which extends Traversable.
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ Reading a result set
+
+ MongoDB\Driver\Manager::executeCommand and
+ MongoDB\Driver\Manager::executeQuery both return
+ their result(s) as a MongoDB\Driver\Cursor object.
+ This object can be used to iterate over the result set of the command or
+ query.
+
+
+ Because MongoDB\Driver\Cursor implements the
+ Traversable interface, you can simply
+ iterate over the result set with
+ foreach.
+
+
+insert(['name' => 'Ceres', 'size' => 946, 'distance' => 2.766]);
+$bulkWrite->insert(['name' => 'Vesta', 'size' => 525, 'distance' => 2.362]);
+$manager->executeBulkWrite("test.asteroids", $bulkWrite);
+
+/* Query for all the items in the collection */
+$query = new MongoDB\Driver\Query( [] );
+
+/* Query the "asteroids" collection of the "test" database */
+$cursor = $manager->executeQuery("test.asteroids", $query);
+
+/* $cursor now contains an object that wraps around the result set. Use
+ * foreach() to iterate over all the result */
+foreach($cursor as $document) {
+ print_r($document);
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+ MongoDB\BSON\ObjectId Object
+ (
+ [oid] => 5a4cff2f122d3321565d8cc2
+ )
+
+ [name] => Ceres
+ [size] => 946
+ [distance] => 2.766
+)
+stdClass Object
+(
+ [_id] => MongoDB\BSON\ObjectId Object
+ (
+ [oid] => 5a4cff2f122d3321565d8cc3
+ )
+
+ [name] => Vesta
+ [size] => 525
+ [distance] => 2.362
+}
+]]>
+
+
+
+
+ Reading a result set for a tailable cursor
+
+ Tailable cursors
+ are a special type of MongoDB cursor that allows the client to read some
+ results and then wait until more documents become available. These cursors
+ are primarily used with
+ Capped Collections
+ and Change Streams.
+
+
+ While normal cursors can be iterated once with foreach,
+ that approach will not work with tailable cursors. When
+ foreach is used with a tailable cursor, the loop will
+ stop upon reaching the end of the initial result set. Attempting to
+ continue iteration on the cursor with a second
+ foreach would throw an exception, since PHP attempts to
+ rewind the cursor. Similar to result objects in other database drivers,
+ cursors in MongoDB only support forward iteration, which means they cannot
+ be rewound.
+
+
+ In order to continuously read from a tailable cursor, the Cursor object
+ must be wrapped with an IteratorIterator. This
+ allows the application to directly control the cursor's iteration, avoid
+ inadvertently rewinding the cursor, and decide when to wait for new results
+ or stop iteration entirely.
+
+
+ In order to demonstrate a tailable cursor in action, two scripts will be
+ used: a "producer" and a "consumer". The producer script will create a new
+ capped collection using the
+ create command
+ and proceed to insert a new document into that collection each second.
+
+
+executeCommand('test', new MongoDB\Driver\Command([
+ 'create' => 'asteroids',
+ 'capped' => true,
+ 'size' => 1048576,
+]));
+
+while (true) {
+ $bulkWrite = new MongoDB\Driver\BulkWrite;
+ $bulkWrite->insert(['createdAt' => new MongoDB\BSON\UTCDateTime]);
+ $manager->executeBulkWrite('test.asteroids', $bulkWrite);
+
+ sleep(1);
+}
+
+?>
+]]>
+
+
+ With the producer script still running, a second consumer script may be
+ executed to read the inserted documents using a tailable cursor, indicated
+ by the tailable and awaitData options
+ to MongoDB\Driver\Query::__construct.
+
+
+ true,
+ 'awaitData' => true,
+]);
+
+$cursor = $manager->executeQuery('test.asteroids', $query);
+
+$iterator = new IteratorIterator($cursor);
+
+$iterator->rewind();
+
+while (true) {
+ if ($iterator->valid()) {
+ $document = $iterator->current();
+ printf("Consumed document created at: %s\n", $document->createdAt);
+ }
+
+ $iterator->next();
+}
+
+?>
+]]>
+
+
+ The consumer script will start by quickly printing all available documents
+ in the capped collection (as if foreach had been used);
+ however, it will not terminate upon reaching the end of the initial result
+ set. Since the cursor is tailable, calling
+ IteratorIterator::next will block and wait for
+ additional results. IteratorIterator::valid is also
+ used to check if there is actually data available to read at each step.
+
+
+
+ This example uses the awaitData query option to
+ instruct the server to block for a short period (e.g. one second) at the
+ end of the result set before returning a response to the driver. This is
+ used to prevent the driver from aggressively polling the server when there
+ are no results available. The maxAwaitTimeMS option may
+ be used in conjunction with tailable and
+ awaitData to specify the amount of time that the server
+ should block when it reaches the end of the result set.
+
+
+
+
+
+
+ &reftitle.errors;
+
+ When iterating over the cursor object, BSON data is converted into PHP
+ variables. This iteration can cause the following Exceptions:
+
+
+
+ Throws
+ MongoDB\Driver\Exception\InvalidArgumentException if
+ a class in the type map cannot be instantiated or does not implement
+ MongoDB\BSON\Unserializable.
+
+ &mongodb.throws.bson.unexpected;
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.cursor;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/construct.xml b/reference/mongodb/mongodb/driver/cursor/construct.xml
new file mode 100644
index 0000000000..35eb15852e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/construct.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::__construct
+ 新しい Cursor (not used) を作成する
+
+
+
+ &reftitle.description;
+
+ finalprivateMongoDB\Driver\Cursor::__construct
+
+
+
+ MongoDB\Driver\Cursor objects are returned as the
+ result of an executed command or query and cannot be constructed directly.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeCommand
+ MongoDB\Driver\Manager::executeQuery
+ MongoDB\Driver\Server::executeCommand
+ MongoDB\Driver\Server::executeQuery
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/current.xml b/reference/mongodb/mongodb/driver/cursor/current.xml
new file mode 100644
index 0000000000..710fcbfa0f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/current.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::current
+ current element を返す
+
+
+
+ &reftitle.description;
+
+ publicarrayobjectnullMongoDB\Driver\Cursor::current
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the current result document as an array or object, depending on the
+ cursor's type map. If iteration has not started or the current position
+ is not valid, &null; will be returned.
+
+
+
+
+ &reftitle.seealso;
+
+ Iterator::current
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/getid.xml b/reference/mongodb/mongodb/driver/cursor/getid.xml
new file mode 100644
index 0000000000..5ad81da62e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/getid.xml
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::getId
+ ID for this cursor を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\Int64MongoDB\Driver\Cursor::getId
+
+
+
+ Returns the ID for this cursor, which uniquely identifies the cursor on the
+ server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the ID for this cursor. The ID will be returned as a
+ MongoDB\BSON\Int64 object.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+ The return type was changed to MongoDB\BSON\Int64.
+ The asInt64 parameter was removed.
+
+
+
+ PECL mongodb 1.20.0
+
+ Deprecated returning a MongoDB\Driver\CursorId.
+ Added the asInt64 argument to ease migration for
+ future versions. If asInt64 is &true;, the ID
+ will be returned as a MongoDB\BSON\Int64.
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Cursor::getId の例
+
+ 2]);
+
+$bulk = new MongoDB\Driver\BulkWrite;
+$bulk->insert(['x' => 1]);
+$bulk->insert(['x' => 2]);
+$bulk->insert(['x' => 3]);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$cursor = $manager->executeQuery('db.collection', $query);
+var_dump($cursor->getId(true));
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(11) "94810124093"
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\BSON\Int64
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/getserver.xml b/reference/mongodb/mongodb/driver/cursor/getserver.xml
new file mode 100644
index 0000000000..5d3aa76241
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/getserver.xml
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::getServer
+ server associated with this cursor を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerMongoDB\Driver\Cursor::getServer
+
+
+
+ Returns the MongoDB\Driver\Server associated with this
+ cursor. This is the server that executed the
+ MongoDB\Driver\Query or
+ MongoDB\Driver\Command.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the MongoDB\Driver\Server associated with this
+ cursor.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Cursor::getServer の例
+
+insert(['x' => 1]);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$cursor = $manager->executeQuery('db.collection', $query);
+var_dump($cursor->getServer());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(9) "localhost"
+ ["port"]=>
+ int(27017)
+ ["type"]=>
+ int(1)
+ ["is_primary"]=>
+ bool(false)
+ ["is_secondary"]=>
+ bool(false)
+ ["is_arbiter"]=>
+ bool(false)
+ ["is_hidden"]=>
+ bool(false)
+ ["is_passive"]=>
+ bool(false)
+ ["last_hello_response"]=>
+ array(8) {
+ ["isWritablePrimary"]=>
+ bool(true)
+ ["maxBsonObjectSize"]=>
+ int(16777216)
+ ["maxMessageSizeBytes"]=>
+ int(48000000)
+ ["maxWriteBatchSize"]=>
+ int(1000)
+ ["localTime"]=>
+ object(MongoDB\BSON\UTCDateTime)#6 (1) {
+ ["milliseconds"]=>
+ int(1446505367907)
+ }
+ ["maxWireVersion"]=>
+ int(3)
+ ["minWireVersion"]=>
+ int(0)
+ ["ok"]=>
+ float(1)
+ }
+ ["round_trip_time"]=>
+ int(584)
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/isdead.xml b/reference/mongodb/mongodb/driver/cursor/isdead.xml
new file mode 100644
index 0000000000..8433d6df3b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/isdead.xml
@@ -0,0 +1,157 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::isDead
+ the cursor is exhausted or may have additional results かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Cursor::isDead
+
+
+
+ Checks whether there are definitely no additional results available on the
+ cursor. This method is similar to the
+ cursor.isExhausted()
+ method in the MongoDB shell and is primarily useful when iterating
+ tailable cursors.
+
+
+ A cursor has no additional results and is considered "dead" when one of the
+ following is true:
+
+
+ The current batch has been fully iterated and the
+ cursor ID is zero (i.e. a
+ getMore
+ cannot be issued).
+
+ An error was encountered while iterating the cursor.
+ The cursor reached its configured limit.
+
+
+
+ By design, it is not possible to always determine whether a cursor has
+ additional results. The cases where a cursor may have
+ more data available is as follows:
+
+
+ There are additional documents in the current batch, which are buffered on
+ the client side. Iterating will fetch a document from the local buffer.
+
+
+ There are no additional documents in the current batch (i.e. local buffer),
+ but the cursor ID is non-zero. Iterating will request more documents from
+ the server via a
+ getMore
+ operation, which may or may not return additional results and/or indicate
+ that the cursor has been closed on the server by returning zero for its ID.
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if there are definitely no additional results available on the
+ cursor, and &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Cursor::isDead の例
+
+insert(['x' => 1]);
+$bulk->insert(['x' => 2]);
+$bulk->insert(['x' => 3]);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$cursor = $manager->executeQuery('db.collection', $query);
+
+$iterator = new IteratorIterator($cursor);
+
+$iterator->rewind();
+var_dump($cursor->isDead());
+
+$iterator->next();
+var_dump($cursor->isDead());
+
+$iterator->next();
+var_dump($cursor->isDead());
+
+$iterator->next();
+var_dump($cursor->isDead());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Tailable Cursors in the MongoDB manual
+ cursor.isExhausted() in the MongoDB manual
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/key.xml b/reference/mongodb/mongodb/driver/cursor/key.xml
new file mode 100644
index 0000000000..eaa0c0e075
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/key.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::key
+ current result の index within the cursor を返す
+
+
+
+ &reftitle.description;
+
+ publicintMongoDB\Driver\Cursor::key
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ The current result's numeric index within the cursor.
+
+
+
+
+ &reftitle.seealso;
+
+ Iterator::key
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/next.xml b/reference/mongodb/mongodb/driver/cursor/next.xml
new file mode 100644
index 0000000000..0de74aff03
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/next.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::next
+ カーソルを次の結果に進める
+
+
+
+ &reftitle.description;
+
+ publicvoidMongoDB\Driver\Cursor::next
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Moves the current position to the next element in the cursor.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+
+
+
+
+ &reftitle.seealso;
+
+ Iterator::next
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/rewind.xml b/reference/mongodb/mongodb/driver/cursor/rewind.xml
new file mode 100644
index 0000000000..0734567b35
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/rewind.xml
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::rewind
+ カーソルを最初の結果に巻き戻す
+
+
+
+ &reftitle.description;
+
+ publicvoidMongoDB\Driver\Cursor::rewind
+
+
+
+ If the cursor has advanced beyond its first position, it can no longer be
+ rewound.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ &null;.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\LogicException if this method is called after the cursor has advanced beyond its first position.
+
+
+
+
+ &reftitle.seealso;
+
+ Iterator::rewind
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/settypemap.xml b/reference/mongodb/mongodb/driver/cursor/settypemap.xml
new file mode 100644
index 0000000000..c367cfe244
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/settypemap.xml
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::setTypeMap
+ BSON のアンシリアライズに使用する型マップを設定する
+
+
+
+ &reftitle.description;
+
+ finalpublicvoidMongoDB\Driver\Cursor::setTypeMap
+ arraytypemap
+
+
+ Sets the type map
+ configuration to use when unserializing the BSON results into PHP
+ values.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.typeMap;
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+ When iterating over the cursor, the following exceptions can also be thrown
+ due to an incorrect type map configuration:
+
+
+ Throws
+ MongoDB\Driver\Exception\InvalidArgumentException if
+ a class in the type map cannot be instantiated or does not implement
+ MongoDB\BSON\Unserializable.
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Cursor::setTypeMap の例
+
+insert(['x' => 1]);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$query = new MongoDB\Driver\Query(['_id' => $id]);
+$cursor = $manager->executeQuery('db.collection', $query);
+$cursor->setTypeMap(['root' => 'array']);
+
+foreach ($cursor as $document) {
+ var_dump($document);
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\BSON\ObjectId)#6 (1) {
+ ["oid"]=>
+ string(24) "56424fb76118fd3267180741"
+ }
+ ["x"]=>
+ int(1)
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/toarray.xml b/reference/mongodb/mongodb/driver/cursor/toarray.xml
new file mode 100644
index 0000000000..24db69e0a9
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/toarray.xml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::toArray
+ array containing all results for this cursor を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\Cursor::toArray
+
+
+
+ Iterates the cursor and returns its results in an array.
+ MongoDB\Driver\Cursor::setTypeMap may be used to control
+ how documents are unserialized into PHP values.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array containing all results for this cursor.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Cursor::toArray の例
+
+insert(['x' => 1]);
+$bulk->insert(['x' => 2]);
+$bulk->insert(['x' => 3]);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$query = new MongoDB\Driver\Query([]);
+$cursor = $manager->executeQuery('db.collection', $query);
+
+var_dump($cursor->toArray());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(stdClass)#6 (2) {
+ ["_id"]=>
+ object(MongoDB\BSON\ObjectId)#5 (1) {
+ ["oid"]=>
+ string(24) "564259a96118fd40b41bcf61"
+ }
+ ["x"]=>
+ int(1)
+ }
+ [1]=>
+ object(stdClass)#8 (2) {
+ ["_id"]=>
+ object(MongoDB\BSON\ObjectId)#7 (1) {
+ ["oid"]=>
+ string(24) "564259a96118fd40b41bcf62"
+ }
+ ["x"]=>
+ int(2)
+ }
+ [2]=>
+ object(stdClass)#10 (2) {
+ ["_id"]=>
+ object(MongoDB\BSON\ObjectId)#9 (1) {
+ ["oid"]=>
+ string(24) "564259a96118fd40b41bcf63"
+ }
+ ["x"]=>
+ int(3)
+ }
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Cursor::setTypeMap
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursor/valid.xml b/reference/mongodb/mongodb/driver/cursor/valid.xml
new file mode 100644
index 0000000000..b6dbe57cb0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursor/valid.xml
@@ -0,0 +1,56 @@
+
+
+
+
+
+
+ MongoDB\Driver\Cursor::valid
+ the current position in the cursor is valid かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ publicboolMongoDB\Driver\Cursor::valid
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ &true; if the current cursor position is valid, &false; otherwise.
+
+
+
+
+ &reftitle.seealso;
+
+ Iterator::valid
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursorid.xml b/reference/mongodb/mongodb/driver/cursorid.xml
new file mode 100644
index 0000000000..1fcd29a70b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursorid.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+ MongoDB\Driver\CursorId クラス
+ MongoDB\Driver\CursorId
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\CursorID class is a value object
+ that represents a cursor ID. Instances of this class are returned by
+ MongoDB\Driver\Cursor::getId.
+
+
+
+ This class has been DEPRECATED as of extension
+ version 1.20.0 and was removed in 2.0. Applications have to update their
+ usage of MongoDB\Driver\Cursor::getId to return
+ MongoDB\BSON\Int64 instead.
+
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\CursorId
+
+
+
+ final
+
+ MongoDB\Driver\CursorId
+
+
+
+ Serializable
+
+
+
+ Stringable
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.class-removed;
+
+ PECL mongodb 1.20.0
+
+ This class has been deprecated and will be removed in version 2.0.
+
+
+
+ PECL mongodb 1.12.0
+
+ PHP 8.0 以降で Stringable を実装しました。
+
+
+
+ PECL mongodb 1.7.0
+
+ Serializable を実装しました。
+
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.cursorid;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursorid/construct.xml b/reference/mongodb/mongodb/driver/cursorid/construct.xml
new file mode 100644
index 0000000000..79f5bcb30b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursorid/construct.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+ MongoDB\Driver\CursorId::__construct
+ 新しい CursorId (not used) を作成する
+
+
+
+ &reftitle.description;
+
+ finalprivateMongoDB\Driver\CursorId::__construct
+
+
+
+ MongoDB\Driver\CursorId objects are returned from
+ MongoDB\Driver\Cursor::getId and cannot be constructed
+ directly.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Cursor::getId
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursorid/tostring.xml b/reference/mongodb/mongodb/driver/cursorid/tostring.xml
new file mode 100644
index 0000000000..3c7ece4363
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursorid/tostring.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+ MongoDB\Driver\CursorId::__toString
+ カーソル ID の文字列表現
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\CursorId::__toString
+
+
+
+ Returns the string representation of the cursor ID.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the string representation of the cursor ID.
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\CursorId::__toString の例
+
+ 2]);
+
+$bulk = new MongoDB\Driver\BulkWrite;
+$bulk->insert(['x' => 1]);
+$bulk->insert(['x' => 2]);
+$bulk->insert(['x' => 3]);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$cursor = $manager->executeQuery('db.collection', $query);
+var_dump((string) $cursor->getId());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Cursor::getId
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursorinterface.xml b/reference/mongodb/mongodb/driver/cursorinterface.xml
new file mode 100644
index 0000000000..3b255e3d6d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursorinterface.xml
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+ MongoDB\Driver\CursorInterface インターフェイス
+ MongoDB\Driver\CursorInterface
+
+
+
+
+
+ &reftitle.intro;
+
+ This interface is implemented by
+ MongoDB\Driver\Cursor to be used as
+ a parameter, return, or property type in userland classes.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\CursorInterface
+
+
+
+
+ MongoDB\Driver\CursorInterface
+
+
+
+ Iterator
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+
+ This interface now extends Iterator.
+
+
+ Return types previously declared as tentative are now enforced.
+
+
+
+ &mongodb.changelog.tentative-return-types;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.cursorinterface;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursorinterface/getid.xml b/reference/mongodb/mongodb/driver/cursorinterface/getid.xml
new file mode 100644
index 0000000000..1d14cfe6fa
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursorinterface/getid.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+ MongoDB\Driver\CursorInterface::getId
+ ID for this cursor を返す
+
+
+
+ &reftitle.description;
+
+ abstractpublicMongoDB\BSON\Int64MongoDB\Driver\CursorInterface::getId
+
+
+
+ Returns the ID for this cursor, which uniquely identifies the cursor on the
+ server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the ID for this cursor.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.20.0
+
+ Added MongoDB\BSON\Int64 to the tentative return
+ type for this method. MongoDB\Driver\CursorId
+ will be removed from the return type in version 2.0.
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Cursor::getId
+ MongoDB\Driver\CursorId
+ MongoDB\BSON\Int64
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursorinterface/getserver.xml b/reference/mongodb/mongodb/driver/cursorinterface/getserver.xml
new file mode 100644
index 0000000000..6f1551795d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursorinterface/getserver.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\CursorInterface::getServer
+ server associated with this cursor を返す
+
+
+
+ &reftitle.description;
+
+ abstractpublicMongoDB\Driver\ServerMongoDB\Driver\CursorInterface::getServer
+
+
+
+ Returns the MongoDB\Driver\Server associated with this
+ cursor. This is the server that executed the
+ MongoDB\Driver\Query or
+ MongoDB\Driver\Command.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the MongoDB\Driver\Server associated with this
+ cursor.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Cursor::getServer
+ MongoDB\Driver\Server
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursorinterface/isdead.xml b/reference/mongodb/mongodb/driver/cursorinterface/isdead.xml
new file mode 100644
index 0000000000..595b0cdbc0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursorinterface/isdead.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+ MongoDB\Driver\CursorInterface::isDead
+ the cursor may have additional results かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ abstractpublicboolMongoDB\Driver\CursorInterface::isDead
+
+
+
+ Checks whether the cursor may have additional results available to read. A
+ cursor is initially "alive" but may become "dead" for any of the following
+ reasons:
+
+ Advancing a non-tailable cursor did not return a document
+ The cursor encountered an error
+ The cursor read its last batch to completion
+ The cursor reached its configured limit
+
+ This is primarily useful with tailable cursors.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if additional results are not available, and &false;
+ otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Cursor::isDead
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml b/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml
new file mode 100644
index 0000000000..c9a3eb708c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\CursorInterface::setTypeMap
+ BSON のアンシリアライズに使用する型マップを設定する
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\CursorInterface::setTypeMap
+ arraytypemap
+
+
+ Sets the type map
+ configuration to use when unserializing the BSON results into PHP
+ values.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.typeMap;
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Cursor::setTypeMap
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/cursorinterface/toarray.xml b/reference/mongodb/mongodb/driver/cursorinterface/toarray.xml
new file mode 100644
index 0000000000..428e00569a
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/cursorinterface/toarray.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ MongoDB\Driver\CursorInterface::toArray
+ array containing all results for this cursor を返す
+
+
+
+ &reftitle.description;
+
+ abstractpublicarrayMongoDB\Driver\CursorInterface::toArray
+
+
+
+ Iterates the cursor and returns its results in an array.
+ MongoDB\Driver\CursorInterface::setTypeMap may be used
+ to control how documents are unserialized into PHP values.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array containing all results for this cursor.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Cursor::toArray
+ MongoDB\Driver\CursorInterface::setTypeMap
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/authenticationexception.xml b/reference/mongodb/mongodb/driver/exception/authenticationexception.xml
new file mode 100644
index 0000000000..302e0ef16f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/authenticationexception.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\AuthenticationException クラス
+ MongoDB\Driver\Exception\AuthenticationException
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when the driver fails to authenticate with the server.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\AuthenticationException
+
+
+
+
+ MongoDB\Driver\Exception\AuthenticationException
+
+
+
+ extends
+ MongoDB\Driver\Exception\ConnectionException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception.xml b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception.xml
new file mode 100644
index 0000000000..5251d491c8
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception.xml
@@ -0,0 +1,166 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\BulkWriteCommandException クラス
+ MongoDB\Driver\Exception\BulkWriteCommandException
+
+
+
+
+
+ &reftitle.intro;
+
+ Exception thrown due to failed execution of a
+ MongoDB\Driver\BulkWriteCommand. The methods of this
+ class provide more details of the error that occurred, including the error
+ reply and partial results from the bulk write.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\BulkWriteCommandException
+
+
+
+
+ MongoDB\Driver\Exception\BulkWriteCommandException
+
+
+
+ extends
+ MongoDB\Driver\Exception\ServerException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &Properties;
+
+ private
+ MongoDB\BSON\Documentnull
+ errorReply
+
+
+ private
+ MongoDB\Driver\BulkWriteCommandResultnull
+ partialResult
+
+
+ private
+ array
+ writeConcernErrors
+
+
+ private
+ array
+ writeErrors
+
+
+ &InheritedProperties;
+
+
+
+
+
+ &Methods;
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.properties;
+
+
+ errorReply
+
+
+ Any top-level error that occurred when attempting to communicate with
+ the server or execute the bulk write. This value may be &null; if the
+ exception was thrown due to errors occurring on individual writes.
+
+
+
+
+ partialResult
+
+
+ A MongoDB\Driver\BulkWriteCommandResult reporting
+ the result of any successful operations that were performed before the
+ error was encountered. This value may be &null; if it cannot be
+ determined that at least one write was successfully performed (and
+ acknowledged).
+
+
+
+
+ writeConcernErrors
+
+
+ An array of any MongoDB\Driver\WriteConcernErrors
+ that occurred while executing the bulk write. This list may have
+ multiple items if more than one server command was required to execute
+ the bulk write.
+
+
+
+
+ writeErrors
+
+
+ An array of any MongoDB\Driver\WriteErrors
+ that occurred during the execution of individual write operations. Array
+ keys will correspond to the index of the write operation from
+ MongoDB\Driver\BulkWriteCommand. This map will
+ contain at most one entry if the bulk write was ordered.
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.exception.entities.bulkwritecommandexception;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/geterrorreply.xml b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/geterrorreply.xml
new file mode 100644
index 0000000000..738363f497
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/geterrorreply.xml
@@ -0,0 +1,145 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\BulkWriteCommandException::getErrorReply
+ トップレベルのコマンドエラーを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\DocumentnullMongoDB\Driver\Exception\BulkWriteCommandException::getErrorReply
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns any top-level error that occurred when attempting to communicate
+ with the server or execute the bulk write. This value may be &null; if the
+ exception was thrown due to errors occurring on individual writes.
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Exception\BulkWriteCommandException::getErrorReply の例
+
+executeCommand('admin', new MongoDB\Driver\Command([
+ 'configureFailPoint' => 'failCommand',
+ 'mode' => ['times' => 1],
+ 'data' => [
+ 'failCommands' => ['bulkWrite'],
+ 'errorCode' => 8, /* UnknownError */
+ ],
+]));
+
+$bulk = new MongoDB\Driver\BulkWriteCommand;
+$bulk->insertOne('db.coll', ['x' => 1]);
+
+try {
+ $result = $manager->executeBulkWriteCommand($bulk);
+} catch (MongoDB\Driver\Exception\BulkWriteCommandException $e) {
+ var_dump($e->getErrorReply()?->toPHP());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ float(0)
+ ["errmsg"]=>
+ string(43) "Failing command via 'failCommand' failpoint"
+ ["code"]=>
+ int(8)
+ ["codeName"]=>
+ string(12) "UnknownError"
+ ["$clusterTime"]=>
+ object(stdClass)#10 (2) {
+ ["clusterTime"]=>
+ object(MongoDB\BSON\Timestamp)#6 (2) {
+ ["increment"]=>
+ string(1) "7"
+ ["timestamp"]=>
+ string(10) "1744319389"
+ }
+ ["signature"]=>
+ object(stdClass)#9 (2) {
+ ["hash"]=>
+ object(MongoDB\BSON\Binary)#7 (2) {
+ ["data"]=>
+ string(20) ""
+ ["type"]=>
+ int(0)
+ }
+ ["keyId"]=>
+ object(MongoDB\BSON\Int64)#8 (1) {
+ ["integer"]=>
+ string(1) "0"
+ }
+ }
+ }
+ ["operationTime"]=>
+ object(MongoDB\BSON\Timestamp)#11 (2) {
+ ["increment"]=>
+ string(1) "7"
+ ["timestamp"]=>
+ string(10) "1744319389"
+ }
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeBulkWriteCommand
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getpartialresult.xml b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getpartialresult.xml
new file mode 100644
index 0000000000..fbacff77b0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getpartialresult.xml
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\BulkWriteCommandException::getPartialResult
+ result of any successful write operations を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\BulkWriteCommandResultnullMongoDB\Driver\Exception\BulkWriteCommandException::getPartialResult
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a MongoDB\Driver\BulkWriteCommandResult
+ reporting the result of any successful operations that were performed before
+ the error was encountered. The return value will be &null; if it cannot be
+ determined that at least one write was successfully performed (and
+ acknowledged).
+
+
+
+
+ &reftitle.examples;
+
+ Partial result if at least one write is successful
+
+deleteMany('db.coll', []);
+$bulk->insertOne('db.coll', ['_id' => 1]);
+$bulk->insertOne('db.coll', ['_id' => 1]);
+
+try {
+ $result = $manager->executeBulkWriteCommand($bulk);
+} catch (MongoDB\Driver\Exception\BulkWriteCommandException $e) {
+ $result = $e->getPartialResult();
+}
+
+var_dump($result?->getInsertedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ No partial result if no writes are successful
+
+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\Exception\BulkWriteCommandException $e) {
+ $result = $e->getPartialResult();
+}
+
+var_dump($result?->getInsertedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommandResult
+ MongoDB\Driver\Manager::executeBulkWriteCommand
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getwriteconcernerrors.xml b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getwriteconcernerrors.xml
new file mode 100644
index 0000000000..622966d268
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getwriteconcernerrors.xml
@@ -0,0 +1,119 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\BulkWriteCommandException::getWriteConcernErrors
+ 書き込み懸念エラーを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\Exception\BulkWriteCommandException::getWriteConcernErrors
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ An array of any MongoDB\Driver\WriteConcernErrors
+ that occurred while executing the bulk write. This list may have multiple
+ items if more than one server command was required to execute the bulk
+ write.
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Exception\BulkWriteCommandException::getWriteConcernErrors の例
+
+insertOne('db.coll', ['x' => 1]);
+
+$writeConcern = new MongoDB\Driver\WriteConcern(50);
+
+try {
+ $result = $manager->executeBulkWriteCommand($bulk, ['writeConcern' => $writeConcern]);
+} catch (MongoDB\Driver\Exception\BulkWriteCommandException $e) {
+ var_dump($e->getWriteConcernErrors());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\Driver\WriteConcernError)#6 (3) {
+ ["message"]=>
+ string(29) "Not enough data-bearing nodes"
+ ["code"]=>
+ int(100)
+ ["info"]=>
+ object(stdClass)#8 (1) {
+ ["writeConcern"]=>
+ object(stdClass)#7 (3) {
+ ["w"]=>
+ int(50)
+ ["wtimeout"]=>
+ int(0)
+ ["provenance"]=>
+ string(14) "clientSupplied"
+ }
+ }
+ }
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeBulkWriteCommand
+ MongoDB\Driver\WriteConcern
+ MongoDB\Driver\WriteConcernError
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getwriteerrors.xml b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getwriteerrors.xml
new file mode 100644
index 0000000000..008b52b741
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getwriteerrors.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrors
+ 書き込みエラーを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrors
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ An array of any MongoDB\Driver\WriteErrors that
+ occurred during the execution of individual write operations. Array keys
+ will correspond to the index of the write operation from
+ MongoDB\Driver\BulkWriteCommand. This map will
+ contain at most one entry if the bulk write was ordered.
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrors の例
+
+ false]);
+$bulk->deleteMany('db.coll', []);
+$bulk->insertOne('db.coll', ['_id' => 1]);
+$bulk->insertOne('db.coll', ['_id' => 1]);
+$bulk->insertOne('db.coll', ['_id' => 1]);
+
+try {
+ $result = $manager->executeBulkWriteCommand($bulk);
+} catch (MongoDB\Driver\Exception\BulkWriteCommandException $e) {
+ var_dump($e->getWriteErrors());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\Driver\WriteError)#5 (4) {
+ ["message"]=>
+ string(78) "E11000 duplicate key error collection: db.coll index: _id_ dup key: { _id: 1 }"
+ ["code"]=>
+ int(11000)
+ ["index"]=>
+ int(2)
+ ["info"]=>
+ object(stdClass)#6 (0) {
+ }
+ }
+ [3]=>
+ object(MongoDB\Driver\WriteError)#7 (4) {
+ ["message"]=>
+ string(78) "E11000 duplicate key error collection: db.coll index: _id_ dup key: { _id: 1 }"
+ ["code"]=>
+ int(11000)
+ ["index"]=>
+ int(3)
+ ["info"]=>
+ object(stdClass)#8 (0) {
+ }
+ }
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeBulkWriteCommand
+ MongoDB\Driver\WriteError
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/bulkwriteexception.xml b/reference/mongodb/mongodb/driver/exception/bulkwriteexception.xml
new file mode 100644
index 0000000000..bffb8a0d10
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/bulkwriteexception.xml
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\BulkWriteException クラス
+ MongoDB\Driver\Exception\BulkWriteException
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when a bulk write operation fails.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\BulkWriteException
+
+
+
+
+ MongoDB\Driver\Exception\BulkWriteException
+
+
+
+ extends
+ MongoDB\Driver\Exception\ServerException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &Properties;
+
+ protected
+ MongoDB\Driver\WriteResult
+ writeResult
+
+
+ &InheritedProperties;
+
+
+
+
+
+ &Methods;
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.properties;
+
+
+ writeResult
+
+
+ The MongoDB\Driver\WriteResult associated with
+ the failed write operation.
+
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+
+ This class now extends
+ MongoDB\Driver\Exception\ServerException
+ instead of
+ MongoDB\Driver\Exception\WriteException.
+
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.exception.entities.bulkwriteexception;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/bulkwriteexception/getwriteresult.xml b/reference/mongodb/mongodb/driver/exception/bulkwriteexception/getwriteresult.xml
new file mode 100644
index 0000000000..4ff5a7bfb6
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/bulkwriteexception/getwriteresult.xml
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\BulkWriteException::getWriteResult
+ WriteResult for the failed write operation を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\WriteResultMongoDB\Driver\Exception\BulkWriteException::getWriteResult
+
+
+
+ Returns the MongoDB\Driver\WriteResult for the failed
+ write operation. The
+ MongoDB\Driver\WriteResult::getWriteErrors and
+ MongoDB\Driver\WriteResult::getWriteConcernError methods
+ may be used to get more details about the failure.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ The MongoDB\Driver\WriteResult for the failed write
+ operation.
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Exception\BulkWriteException::getWriteResult の例
+
+insert(['_id' => 1]);
+$bulk->insert(['_id' => 1]);
+
+try {
+ $manager->executeBulkWrite('db.collection', $bulk);
+} catch (MongoDB\Driver\Exception\BulkWriteException $e) {
+ $writeResult = $e->getWriteResult();
+
+ if ($writeConcernError = $writeResult->getWriteConcernError()) {
+ var_dump($writeConcernError);
+ }
+
+ if ($writeErrors = $writeResult->getWriteErrors()) {
+ var_dump($writeErrors);
+ }
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\Driver\WriteError)#5 (4) {
+ ["message"]=>
+ string(70) "E11000 duplicate key error index: db.collection.$_id_ dup key: { : 1 }"
+ ["code"]=>
+ int(11000)
+ ["index"]=>
+ int(1)
+ ["info"]=>
+ NULL
+ }
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteResult
+ MongoDB\Driver\Manager::executeBulkWrite
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/commandexception.xml b/reference/mongodb/mongodb/driver/exception/commandexception.xml
new file mode 100644
index 0000000000..8f268df6b7
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/commandexception.xml
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\CommandException クラス
+ MongoDB\Driver\Exception\CommandException
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when a command fails.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\CommandException
+
+
+
+
+ MongoDB\Driver\Exception\CommandException
+
+
+
+ extends
+ MongoDB\Driver\Exception\ServerException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &Properties;
+
+ protected
+ object
+ resultDocument
+
+
+ &InheritedProperties;
+
+
+
+
+
+ &Methods;
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.properties;
+
+
+ resultDocument
+
+
+ The result document associated with the failed command.
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.exception.entities.commandexception;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/commandexception/getresultdocument.xml b/reference/mongodb/mongodb/driver/exception/commandexception/getresultdocument.xml
new file mode 100644
index 0000000000..78ef46618b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/commandexception/getresultdocument.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\CommandException::getResultDocument
+ result document for the failed command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectMongoDB\Driver\Exception\CommandException::getResultDocument
+
+
+
+ Returns the result document for the failed command.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ The result document for the failed command.
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeCommand
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/connectionexception.xml b/reference/mongodb/mongodb/driver/exception/connectionexception.xml
new file mode 100644
index 0000000000..24ee34ab68
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/connectionexception.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\ConnectionException クラス
+ MongoDB\Driver\Exception\ConnectionException
+
+
+
+
+
+ &reftitle.intro;
+
+ Base class for exceptions thrown when the driver fails to establish a
+ database connection.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\ConnectionException
+
+
+
+
+ MongoDB\Driver\Exception\ConnectionException
+
+
+
+ extends
+ MongoDB\Driver\Exception\RuntimeException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/connectiontimeoutexception.xml b/reference/mongodb/mongodb/driver/exception/connectiontimeoutexception.xml
new file mode 100644
index 0000000000..ddca387dfd
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/connectiontimeoutexception.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\ConnectionTimeoutException クラス
+ MongoDB\Driver\Exception\ConnectionTimeoutException
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when the driver fails to establish a database connection within a
+ specified time limit
+ (connectTimeoutMS)
+ or server selection fails
+ (serverSelectionTimeoutMS).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\ConnectionTimeoutException
+
+
+
+ final
+
+ MongoDB\Driver\Exception\ConnectionTimeoutException
+
+
+
+ extends
+ MongoDB\Driver\Exception\ConnectionException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/encryptionexception.xml b/reference/mongodb/mongodb/driver/exception/encryptionexception.xml
new file mode 100644
index 0000000000..88752e333c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/encryptionexception.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\EncryptionException クラス
+ MongoDB\Driver\Exception\EncryptionException
+
+
+
+
+
+ &reftitle.intro;
+
+ Base class for exceptions thrown during client-side encryption.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\EncryptionException
+
+
+
+
+ MongoDB\Driver\Exception\EncryptionException
+
+
+
+ extends
+ MongoDB\Driver\Exception\RuntimeException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/exception.xml b/reference/mongodb/mongodb/driver/exception/exception.xml
new file mode 100644
index 0000000000..9ec602f266
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/exception.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\Exception インターフェイス
+ MongoDB\Driver\Exception\Exception
+
+
+
+
+
+ &reftitle.intro;
+
+ Common interface for all extension exceptions. This interface is also used
+ by the library, and may be used to identify any exceptions originating from
+ the MongoDB PHP driver (i.e. extension and library).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/executiontimeoutexception.xml b/reference/mongodb/mongodb/driver/exception/executiontimeoutexception.xml
new file mode 100644
index 0000000000..3389b39eff
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/executiontimeoutexception.xml
@@ -0,0 +1,116 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\ExecutionTimeoutException クラス
+ MongoDB\Driver\Exception\ExecutionTimeoutException
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when a query or command fails to complete within a specified time
+ limit (e.g.
+ maxTimeMS).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\ExecutionTimeoutException
+
+
+
+ final
+
+ MongoDB\Driver\Exception\ExecutionTimeoutException
+
+
+
+ extends
+ MongoDB\Driver\Exception\ServerException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.5.0
+
+
+ This class now extends
+ MongoDB\Driver\Exception\ServerException
+ instead of
+ MongoDB\Driver\Exception\RuntimeException.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/invalidargumentexception.xml b/reference/mongodb/mongodb/driver/exception/invalidargumentexception.xml
new file mode 100644
index 0000000000..8b0f92c7b6
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/invalidargumentexception.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\InvalidArgumentException クラス
+ MongoDB\Driver\Exception\InvalidArgumentException
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when a driver method is given invalid arguments (e.g. invalid option
+ types).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\InvalidArgumentException
+
+
+
+
+ MongoDB\Driver\Exception\InvalidArgumentException
+
+
+
+ extends
+ InvalidArgumentException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/logicexception.xml b/reference/mongodb/mongodb/driver/exception/logicexception.xml
new file mode 100644
index 0000000000..70b9dc9a86
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/logicexception.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\LogicException クラス
+ MongoDB\Driver\Exception\LogicException
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when the driver is incorrectly used (e.g. rewinding a cursor).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\LogicException
+
+
+
+
+ MongoDB\Driver\Exception\LogicException
+
+
+
+ extends
+ LogicException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/runtimeexception.xml b/reference/mongodb/mongodb/driver/exception/runtimeexception.xml
new file mode 100644
index 0000000000..56d45f7e0b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/runtimeexception.xml
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\RuntimeException クラス
+ MongoDB\Driver\Exception\RuntimeException
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when the driver encounters a runtime error (e.g. internal error from
+ libmongoc).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\RuntimeException
+
+
+
+
+ MongoDB\Driver\Exception\RuntimeException
+
+
+
+ extends
+ RuntimeException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &Properties;
+
+ protected
+ arraynull
+ errorLabels
+
+
+ &InheritedProperties;
+
+
+
+ &Methods;
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+ &reftitle.properties;
+
+
+ errorLabels
+
+
+ Contains an array of error labels to go with an exception. For example,
+ error labels can be used to detect whether a transaction can be retried
+ safely if the TransientTransactionError label is
+ present. The existence of a specific error label should be tested for
+ with the
+ MongoDB\Driver\Exception\RuntimeException::hasErrorLabel,
+ instead of interpreting this errorLabels property
+ manually.
+
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.6.0
+
+
+ The
+ MongoDB\Driver\Exception\RuntimeException::hasErrorLabel
+ method and
+ MongoDB\Driver\Exception\RuntimeException::errorLabels
+ property have been added.
+
+
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.exception.entities.runtimeexception;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/runtimeexception/haserrorlabel.xml b/reference/mongodb/mongodb/driver/exception/runtimeexception/haserrorlabel.xml
new file mode 100644
index 0000000000..3a3c442092
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/runtimeexception/haserrorlabel.xml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\RuntimeException::hasErrorLabel
+ an error label is associated with an exception かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Exception\RuntimeException::hasErrorLabel
+ stringerrorLabel
+
+
+ Returns whether the errorLabel has been set for this
+ exception. Error labels are set by either the server or the extension to
+ indicate specific situations that may be handled by an application. A common
+ situation might be determining whether to safely retry a transaction that
+ failed due to a transient error (e.g. network error, transaction conflict).
+ Examples of error labels are TransientTransactionError
+ and UnknownTransactionCommitResult.
+
+
+
+
+
+ &reftitle.parameters;
+
+
+ errorLabel
+
+ The name of the errorLabel to test for.
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Whether the given errorLabel is associated with this
+ exception.
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Session::commitTransaction
+ MongoDB documentation on transactions
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/serverexception.xml b/reference/mongodb/mongodb/driver/exception/serverexception.xml
new file mode 100644
index 0000000000..4d2ed0cdcd
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/serverexception.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\ServerException クラス
+ MongoDB\Driver\Exception\ServerException
+
+
+
+
+
+ &reftitle.intro;
+
+ Base class for exceptions thrown by the server. The code of this exception and its subclasses will correspond to the original error code from the server.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\ServerException
+
+
+
+
+ MongoDB\Driver\Exception\ServerException
+
+
+
+ extends
+ MongoDB\Driver\Exception\RuntimeException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/sslconnectionexception.xml b/reference/mongodb/mongodb/driver/exception/sslconnectionexception.xml
new file mode 100644
index 0000000000..aeb92604ac
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/sslconnectionexception.xml
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\SSLConnectionException クラス
+ MongoDB\Driver\Exception\SSLConnectionException
+
+
+
+
+
+ This exception class is DEPRECATED as of extension
+ version 1.5.0 and was removed in 2.0. This exception was never thrown
+ by the extension. Applications should use
+ MongoDB\Driver\Exception\ConnectionException instead.
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when the driver fails to establish an SSL connection with the server.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\SSLConnectionException
+
+
+
+ final
+
+ MongoDB\Driver\Exception\SSLConnectionException
+
+
+
+ extends
+ MongoDB\Driver\Exception\ConnectionException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/unexpectedvalueexception.xml b/reference/mongodb/mongodb/driver/exception/unexpectedvalueexception.xml
new file mode 100644
index 0000000000..d9fee6357b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/unexpectedvalueexception.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\UnexpectedValueException クラス
+ MongoDB\Driver\Exception\UnexpectedValueException
+
+
+
+
+
+ &reftitle.intro;
+
+ Thrown when the driver encounters an unexpected value (e.g. during BSON
+ serialization or deserialization).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\UnexpectedValueException
+
+
+
+
+ MongoDB\Driver\Exception\UnexpectedValueException
+
+
+
+ extends
+ UnexpectedValueException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &InheritedProperties;
+
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/writeexception.xml b/reference/mongodb/mongodb/driver/exception/writeexception.xml
new file mode 100644
index 0000000000..f4daa0a239
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/writeexception.xml
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\WriteException クラス
+ MongoDB\Driver\Exception\WriteException
+
+
+
+
+
+ This exception class is DEPRECATED as of extension
+ version 1.20.0 and was removed in 2.0. This exception was never directly
+ thrown by the extension. Applications should use
+ MongoDB\Driver\Exception\BulkWriteException instead.
+
+
+
+
+
+ &reftitle.intro;
+
+ Base class for exceptions thrown by a failed write operation. The exception
+ encapsulates a MongoDB\Driver\WriteResult object.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Exception\WriteException
+
+
+
+
+ abstract
+ MongoDB\Driver\Exception\WriteException
+
+
+
+ extends
+ MongoDB\Driver\Exception\ServerException
+
+
+
+ MongoDB\Driver\Exception\Exception
+
+
+
+ &Properties;
+
+ protected
+ MongoDB\Driver\WriteResult
+ writeResult
+
+
+ &InheritedProperties;
+
+
+
+
+
+ &Methods;
+
+
+ &InheritedMethods;
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.properties;
+
+
+ writeResult
+
+
+ The MongoDB\Driver\WriteResult associated with
+ the failed write operation.
+
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.class-removed;
+
+ PECL mongodb 1.20.0
+
+ This class has been deprecated and will be removed in version 2.0.
+
+
+
+ PECL mongodb 1.5.0
+
+
+ This class now extends
+ MongoDB\Driver\Exception\ServerException
+ instead of
+ MongoDB\Driver\Exception\RuntimeException.
+
+
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.exception.entities.writeexception;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/exception/writeexception/getwriteresult.xml b/reference/mongodb/mongodb/driver/exception/writeexception/getwriteresult.xml
new file mode 100644
index 0000000000..203dee55d0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/exception/writeexception/getwriteresult.xml
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+ MongoDB\Driver\Exception\WriteException::getWriteResult
+ WriteResult for the failed write operation を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\WriteResultMongoDB\Driver\Exception\WriteException::getWriteResult
+
+
+
+ Returns the MongoDB\Driver\WriteResult for the failed
+ write operation. The
+ MongoDB\Driver\WriteResult::getWriteErrors and
+ MongoDB\Driver\WriteResult::getWriteConcernError methods
+ may be used to get more details about the failure.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ The MongoDB\Driver\WriteResult for the failed write
+ operation.
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Exception\WriteException::getWriteResult の例
+
+insert(['_id' => 1]);
+$bulk->insert(['_id' => 1]);
+
+try {
+ $manager->executeBulkWrite('db.collection', $bulk);
+} catch (MongoDB\Driver\Exception\WriteException $e) {
+ $writeResult = $e->getWriteResult();
+
+ if ($writeConcernError = $writeResult->getWriteConcernError()) {
+ var_dump($writeConcernError);
+ }
+
+ if ($writeErrors = $writeResult->getWriteErrors()) {
+ var_dump($writeErrors);
+ }
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\Driver\WriteError)#5 (4) {
+ ["message"]=>
+ string(70) "E11000 duplicate key error index: db.collection.$_id_ dup key: { : 1 }"
+ ["code"]=>
+ int(11000)
+ ["index"]=>
+ int(1)
+ ["info"]=>
+ NULL
+ }
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteResult
+ MongoDB\Driver\Manager::executeBulkWrite
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager.xml b/reference/mongodb/mongodb/driver/manager.xml
new file mode 100644
index 0000000000..a1312916da
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager.xml
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager クラス
+ MongoDB\Driver\Manager
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Manager is the main entry point
+ to the extension. It is responsible for maintaining connections to MongoDB
+ (be it standalone server, replica set, or sharded cluster).
+
+
+ No connection to MongoDB is made upon instantiating the Manager.
+ This means the MongoDB\Driver\Manager can always be
+ constructed, even though one or more MongoDB servers are down.
+
+
+ Any write or query can throw connection exceptions as connections are created lazily.
+ A MongoDB server may also become unavailable during the life time of the script.
+ It is therefore important that all actions on the Manager to be wrapped in try/catch statements.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Manager
+
+
+
+ final
+
+ MongoDB\Driver\Manager
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ MongoDB\Driver\Manager::__construct basic example
+
+ var_dumping a
+ MongoDB\Driver\Manager will print out various
+ details about the manager that are otherwise not normally exposed.
+ This can be useful to debug how the driver views your MongoDB setup, and
+ which options are used.
+
+
+
+]]>
+
+ &example.outputs.similar;
+
+
+ string(26) "mongodb://127.0.0.1:27017/"
+ ["cluster"]=>
+ array(0) {
+ }
+}
+]]>
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.manager;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/addsubscriber.xml b/reference/mongodb/mongodb/driver/manager/addsubscriber.xml
new file mode 100644
index 0000000000..d2acd78aa5
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/addsubscriber.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::addSubscriber
+ この Manager にモニタリングイベントサブスクライバーを登録する
+
+
+
+ &reftitle.description;
+
+ finalpublicvoidMongoDB\Driver\Manager::addSubscriber
+ MongoDB\Driver\Monitoring\Subscribersubscriber
+
+
+ Registers a monitoring event subscriber with this Manager. The subscriber
+ will be notified of all events for this Manager.
+
+
+
+ If subscriber is already registered with this
+ Manager, this function is a no-op. If subscriber is
+ also registered globally, it will still only be notified once of each event
+ for this Manager.
+
+
+
+
+
+ &reftitle.parameters;
+
+
+ subscriber (MongoDB\Driver\Monitoring\Subscriber)
+
+
+ A monitoring event subscriber to register with this Manager.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+ Throws
+ MongoDB\Driver\Exception\InvalidArgumentException if
+ subscriber is a
+ MongoDB\Driver\Monitoring\LogSubscriber, since
+ loggers can only be registered globally.
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::removeSubscriber
+ MongoDB\Driver\Monitoring\Subscriber
+ MongoDB\Driver\Monitoring\CommandSubscriber
+ MongoDB\Driver\Monitoring\addSubscriber
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/construct.xml b/reference/mongodb/mongodb/driver/manager/construct.xml
new file mode 100644
index 0000000000..6531c697aa
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/construct.xml
@@ -0,0 +1,1285 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::__construct
+ 新しい MongoDB Manager を作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\Manager::__construct
+ stringnulluri&null;
+ arraynulluriOptions&null;
+ arraynulldriverOptions&null;
+
+
+ Constructs a new MongoDB\Driver\Manager object with the specified options.
+
+
+
+ Per the Server Discovery and Monitoring Specification,
+ this constructor performs no I/O. Connections will be initialized on demand,
+ when the first operation is executed.
+
+
+
+
+ When specifying any SSL or TLS URI options via the connection string or
+ uriOptions parameter, the extension will implicitly
+ enable TLS for its connections. To avoid this, either explicitly disable the
+ tls option or don't specify any TLS options.
+
+
+ &mongodb.note.forking;
+
+
+
+ &reftitle.parameters;
+
+
+ uri
+
+
+ A mongodb:// connection URI:
+
+
+
+
+
+ Defaults to "mongodb://127.0.0.1:27017" if unspecified.
+
+
+ For details on supported URI options, see
+ Connection String Options
+ in the MongoDB manual.
+ Connection pool options
+ are not supported, as the extension does not implement connection pools.
+
+
+ The uri is a URL, hence any special characters in
+ its components need to be URL encoded according to
+ RFC 3986. This is particularly
+ relevant to the username and password, which can often include special
+ characters such as @, :, or
+ %. When connecting via a Unix domain socket, the socket
+ path may contain special characters such as slashes and must be encoded.
+ The rawurlencode function may be used to encode
+ constituent parts of the URI.
+
+
+ The defaultAuthDb component may be used to specify the
+ database name associated with the user's credentials; however the
+ authSource URI option will take priority if specified.
+ If neither defaultAuthDb nor
+ authSource are specified, the admin
+ database will be used by default. The defaultAuthDb
+ component has no effect in the absence of user credentials.
+
+
+
+
+ uriOptions
+
+
+ Additional
+ connection string options,
+ which will overwrite any options with the same name in the
+ uri parameter.
+
+
+
+ uriOptions
+
+
+
+ Option
+ Type
+ Description
+
+
+
+
+ appname
+ string
+
+
+ MongoDB 3.4+ has the ability to annotate connections with metadata
+ provided by the connecting client. This metadata is included in the
+ server's logs upon establishing a connection and also recorded in
+ slow query logs when database profiling is enabled.
+
+
+ This option may be used to specify an application name, which will
+ be included in the metadata. The value cannot exceed 128 characters
+ in length.
+
+
+
+
+ authMechanism
+ string
+
+
+ The authentication mechanism that MongoDB will use to authenticate
+ the connection. For additional details and a list of supported
+ values, see
+ Authentication Options
+ in the MongoDB manual.
+
+
+
+
+ authMechanismProperties
+ array
+
+
+ Properties for the selected authentication mechanism. For additional
+ details and a list of supported properties, see the
+ Driver Authentication Specification.
+
+
+
+ When not specified in the URI string, this option is expressed as
+ an array of key/value pairs. The keys and values in this array
+ should be strings.
+
+
+
+
+
+ authSource
+ string
+
+
+ The database name associated with the user's credentials. Defaults
+ to the database component of the connection URI, or the
+ admin database if both are unspecified.
+
+
+ For authentication mechanisms that delegate credential storage to
+ other services (e.g. GSSAPI), this should be
+ "$external".
+
+
+
+
+ compressors
+ string
+
+
+ A prioritized, comma-delimited list of compressors that the client
+ wants to use. Messages are only compressed if the client and server
+ share any compressors in common, and the compressor used in each
+ direction will depend on the individual configuration of the server
+ or driver. See the
+ Driver Compression Specification
+ for more information.
+
+
+
+
+ connectTimeoutMS
+ int
+
+
+ The time in milliseconds to attempt a connection before timing out.
+ Defaults to 10,000 milliseconds.
+
+
+
+
+ directConnection
+ bool
+
+
+ This option can be used to control replica set discovery behavior
+ when only a single host is provided in the connection string. By
+ default, providing a single member in the connection string will
+ establish a direct connection or discover additional members
+ depending on whether the "replicaSet" URI option
+ is omitted or present, respectively. Specify &false; to force
+ discovery to occur (if "replicaSet" is omitted)
+ or specify &true; to force a direct connection (if
+ "replicaSet" is present).
+
+
+
+
+ heartbeatFrequencyMS
+ int
+
+
+ Specifies the interval in milliseconds between the driver's checks
+ of the MongoDB topology, counted from the end of the previous check
+ until the beginning of the next one. Defaults to 60,000
+ milliseconds.
+
+
+ Per the
+ Server Discovery and Monitoring Specification,
+ this value cannot be less than 500 milliseconds.
+
+
+
+
+ journal
+ bool
+
+
+ Corresponds to the default write concern's
+ journal parameter. If &true;, writes will
+ require acknowledgement from MongoDB that the operation has been
+ written to the journal. For details, see
+ MongoDB\Driver\WriteConcern.
+
+
+
+
+ loadBalanced
+ bool
+
+
+ Specifies whether the driver is connecting to a MongoDB cluster
+ through a load balancer. If &true;, the driver may only connect to a
+ single host (specified by either the connection string or SRV
+ lookup), the "directConnection" URI option
+ cannot be &true;, and the "replicaSet" URI option
+ must be omitted. Defaults to &false;.
+
+
+
+
+ localThresholdMS
+ int
+
+
+ The size in milliseconds of the latency window for selecting among
+ multiple suitable MongoDB instances while resolving a read
+ preference. Defaults to 15 milliseconds.
+
+
+
+
+ maxStalenessSeconds
+ int
+
+
+ Corresponds to the read preference's
+ "maxStalenessSeconds". Specifies, in seconds, how
+ stale a secondary can be before the client stops using it for read
+ operations. By default, there is no maximum staleness and clients
+ will not consider a secondary’s lag when choosing where to direct a
+ read operation. For details, see
+ MongoDB\Driver\ReadPreference.
+
+
+ If specified, the max staleness must be a signed 32-bit integer
+ greater than or equal to
+ MongoDB\Driver\ReadPreference::SMALLEST_MAX_STALENESS_SECONDS
+ (i.e. 90 seconds).
+
+
+
+
+ password
+ string
+
+ The password for the user being authenticated. This option is useful
+ if the password contains special characters, which would otherwise
+ need to be URL encoded for the connection URI.
+
+
+
+ readConcernLevel
+ string
+
+ Corresponds to the read concern's level
+ parameter. Specifies the level of read isolation. For details, see
+ MongoDB\Driver\ReadConcern.
+
+
+
+ readPreference
+ string
+
+
+ Corresponds to the read preference's mode
+ parameter. Defaults to "primary". For details,
+ see MongoDB\Driver\ReadPreference.
+
+
+
+
+ readPreferenceTags
+ array
+
+
+ Corresponds to the read preference's tagSets
+ parameter. Tag sets allow you to target read operations to specific
+ members of a replica set. For details, see
+ MongoDB\Driver\ReadPreference.
+
+
+
+ When not specified in the URI string, this option is expressed as
+ an array consistent with the format expected by
+ MongoDB\Driver\ReadPreference::__construct.
+
+
+
+
+
+ replicaSet
+ string
+
+
+ Specifies the name of the replica set.
+
+
+
+
+ retryReads
+ bool
+
+
+ Specifies whether or not the driver should automatically retry
+ certain read operations that fail due to transient network errors
+ or replica set elections. This functionality requires MongoDB 3.6+.
+ Defaults to &true;.
+
+
+ See the
+ Retryable Reads Specification
+ for more information.
+
+
+
+
+ retryWrites
+ bool
+
+
+ Specifies whether or not the driver should automatically retry
+ certain write operations that fail due to transient network errors
+ or replica set elections. This functionality requires MongoDB 3.6+.
+ Defaults to &true;.
+
+
+ See
+ Retryable Writes
+ in the MongoDB manual for more information.
+
+
+
+
+ serverSelectionTimeoutMS
+ int
+
+
+ Specifies how long in milliseconds to block for server selection
+ before throwing an exception. Defaults to 30,000 milliseconds.
+
+
+
+
+ serverSelectionTryOnce
+ bool
+
+
+ When &true;, instructs the driver to scan the MongoDB deployment
+ exactly once after server selection fails and then either select a
+ server or raise an error. When &false;, the driver blocks and
+ searches for a server up to the
+ "serverSelectionTimeoutMS" value. Defaults to
+ &true;.
+
+
+
+
+ socketCheckIntervalMS
+ int
+
+
+ If a socket has not been used recently, the driver must check it via
+ a hello command before using it for any
+ operation. Defaults to 5,000 milliseconds.
+
+
+
+
+ socketTimeoutMS
+ int
+
+
+ The time in milliseconds to attempt a send or receive on a socket
+ before timing out. Defaults to 300,000 milliseconds (i.e. five
+ minutes).
+
+
+
+
+ srvMaxHosts
+ int
+
+
+ The maximum number of SRV results to randomly select when initially
+ populating the seedlist or, during SRV polling, adding new hosts to
+ the topology. Defaults to 0 (i.e. no maximum).
+
+
+
+
+ srvServiceName
+ string
+
+
+ The service name to use for SRV lookup in initial DNS seedlist
+ discovery and SRV polling. Defaults to "mongodb".
+
+
+
+
+ tls
+ bool
+
+
+ Initiates the connection with TLS/SSL if &true;. Defaults to
+ &false;.
+
+
+
+
+ tlsAllowInvalidCertificates
+ bool
+
+
+ Specifies whether or not the driver should error when the server's
+ TLS certificate is invalid. Defaults to &false;.
+
+
+
+ Disabling certificate validation creates a vulnerability.
+
+
+
+
+
+ tlsAllowInvalidHostnames
+ bool
+
+
+ Specifies whether or not the driver should error when there is a
+ mismatch between the server's hostname and the hostname specified by
+ the TLS certificate. Defaults to &false;.
+
+
+
+ Disabling certificate validation creates a vulnerability. Allowing
+ invalid hostnames may expose the driver to a
+ man-in-the-middle attack.
+
+
+
+
+
+ tlsCAFile
+ string
+
+
+ Path to file with either a single or bundle of certificate
+ authorities to be considered trusted when making a TLS connection.
+ The system certificate store will be used by default.
+
+
+
+
+ tlsCertificateKeyFile
+ string
+
+
+ Path to the client certificate file or the client private key file;
+ in the case that they both are needed, the files should be
+ concatenated.
+
+
+
+
+ tlsCertificateKeyFilePassword
+ string
+
+
+ Password to decrypt the client private key (i.e.
+ "tlsCertificateKeyFile" URI option) to be used
+ for TLS connections.
+
+
+
+
+ tlsDisableCertificateRevocationCheck
+ bool
+
+
+ If &true;, the driver will not attempt to check certificate
+ revocation status (e.g. OCSP, CRL). Defaults to &false;.
+
+
+
+
+ tlsDisableOCSPEndpointCheck
+ bool
+
+
+ If &true;, the driver will not attempt to contact an OCSP responder
+ endpoint if needed (i.e. an OCSP response is not stapled). Defaults
+ to &false;.
+
+
+
+
+ tlsInsecure
+ bool
+
+
+ Relax TLS constraints as much as possible. Specifying &true; for
+ this option has the same effect as specifying &true; for both the
+ "tlsAllowInvalidCertificates" and
+ "tlsAllowInvalidHostnames" URI options. Defaults
+ to &false;.
+
+
+
+ Disabling certificate validation creates a vulnerability. Allowing
+ invalid hostnames may expose the driver to a
+ man-in-the-middle attack.
+
+
+
+
+
+ username
+ string
+
+ The username for the user being authenticated. This option is useful
+ if the username contains special characters, which would otherwise
+ need to be URL encoded for the connection URI.
+
+
+
+ w
+ intstring
+
+
+ Corresponds to the default write concern's w
+ parameter. For details, see
+ MongoDB\Driver\WriteConcern.
+
+
+
+
+ wTimeoutMS
+ intstring
+
+
+ Corresponds to the default write concern's
+ wtimeout parameter. Specifies a time limit,
+ in milliseconds, for the write concern. For details, see
+ MongoDB\Driver\WriteConcern.
+
+
+ If specified, wTimeoutMS must be a signed 32-bit
+ integer greater than or equal to zero.
+
+
+
+
+ zlibCompressionLevel
+ int
+
+
+ Specifies the compression level to use for the zlib compressor. This
+ option has no effect if zlib is not included in
+ the "compressors" URI option. See the
+ Driver Compression Specification
+ for more information.
+
+
+
+
+
+
+
+
+
+
+ driverOptions
+
+
+
+ driverOptions
+
+
+
+ Option
+ Type
+ Description
+
+
+
+
+ autoEncryption
+ array
+
+
+ Provides options to enable automatic client-side field level
+ encryption. The list of options is described in the table below.
+
+
+
+ Automatic encryption is an enterprise-only feature that only
+ applies to operations on a collection. Automatic encryption is not
+ supported for operations on a database or view, and operations that
+ are not bypassed will result in error (see
+ libmongocrypt: Auto Encryption Allow-List). To bypass automatic encryption
+ for all operations, set bypassAutoEncryption to
+ &true;.
+
+
+ Automatic encryption requires the authenticated user to have the
+ listCollections
+ privilege action.
+
+
+ Explicit encryption/decryption and automatic decryption is a
+ community feature. The driver can still automatically decrypt when
+ bypassAutoEncryption is &true;.
+
+
+
+
+
+ ca_dir
+ string
+
+
+ Path to a correctly hashed certificate directory. The system
+ certificate store will be used by default.
+
+
+
+
+ crl_file
+ string
+ Path to a certificate revocation list file.
+
+
+ disableClientPersistence
+ bool
+
+
+ If &true;, this Manager will use a new libmongoc client, which will
+ not be persisted or shared with other Manager objects. When this
+ Manager object is freed, its client will be destroyed and any
+ connections will be closed. Defaults to &false;.
+
+
+
+ Disabling client persistence is not generally recommended.
+
+
+
+
+
+ driver
+ array
+
+
+ Allows a higher level library to append its own metadata to the
+ server handshake. By default, the extension submits its own name,
+ version, and platform (i.e. PHP version) in the handshake. Strings
+ can be specified for the "name",
+ "version", and "platform" keys
+ of this array, and will be appended to the respective field(s) in
+ the handshake document.
+
+
+
+ Handshake information is limited to 512 bytes. The extension will
+ truncate handshake data to fit within this 512-byte string. Higher
+ level libraries are encouraged to keep their own metadata concise.
+
+
+
+
+
+ serverApi
+ MongoDB\Driver\ServerApi
+
+
+ This option is used to declare a server API version for the manager.
+ If omitted, no API version is declared.
+
+
+
+
+
+
+
+
+ Options supported by automatic encryption through the autoEncryption driver option:
+
+ autoEncryption
+
+
+
+ Option
+ Type
+ Description
+
+
+
+ &mongodb.option.encryption.keyVaultClient;
+ &mongodb.option.encryption.keyVaultNamespace;
+ &mongodb.option.encryption.kmsProviders;
+ &mongodb.option.encryption.tlsOptions;
+
+ schemaMap
+ arrayobject
+
+
+ Map of collection namespaces to a local JSON schema. This is
+ used to configure automatic encryption. See
+ Automatic Encryption Rules
+ in the MongoDB manual for more information. It is an error to
+ specify a collection in both schemaMap and
+ encryptedFieldsMap.
+
+
+
+ Supplying a schemaMap provides more
+ security than relying on JSON schemas obtained from the
+ server. It protects against a malicious server advertising a
+ false JSON schema, which could trick the client into sending
+ unencrypted data that should be encrypted.
+
+
+
+
+ Schemas supplied in the schemaMap only
+ apply to configuring automatic encryption for client side
+ encryption. Other validation rules in the JSON schema will
+ not be enforced by the driver and will result in an error.
+
+
+
+
+
+ bypassAutoEncryption
+ bool
+
+ If &true;, mongocryptd will not be spawned
+ automatically. This is used to disable automatic encryption.
+ Defaults to &false;.
+
+
+
+ bypassQueryAnalysis
+ bool
+
+
+ If &true;, automatic analysis of outgoing commands will be
+ disabled and mongocryptd will not be
+ spawned automatically. This enables the use case of explicit
+ encryption for querying indexed fields without requiring the
+ enterprise licensed crypt_shared library or
+ mongocryptd process. Defaults to &false;.
+
+
+
+
+ encryptedFieldsMap
+ arrayobject
+
+
+ Map of collection namespaces to an
+ encryptedFields document. This is used to
+ configure queryable encryption. See
+ Field Encryption and Queryability
+ in the MongoDB manual for more information. It is an error to
+ specify a collection in both
+ encryptedFieldsMap and
+ schemaMap.
+
+
+
+ Supplying an encryptedFieldsMap provides
+ more security than relying on an
+ encryptedFields obtained from the server.
+ It protects against a malicious server advertising a false
+ encryptedFields.
+
+
+
+
+
+ extraOptions
+ array
+
+
+ The extraOptions relate to the
+ mongocryptd process. The following options
+ are supported:
+
+
+ mongocryptdURI (string): URI to connect to an existing mongocryptd process. Defaults to "mongodb://localhost:27020".
+ mongocryptdBypassSpawn (bool): If &true;, prevent the driver from spawning mongocryptd. Defaults to &false;.
+ mongocryptdSpawnPath (string): Absolute path to search for mongocryptd binary. Defaults to empty string and consults system paths.
+ mongocryptdSpawnArgs (array): Array of string arguments to pass to mongocryptd when spawning. Defaults to ["--idleShutdownTimeoutSecs=60"].
+ cryptSharedLibPath (string): Absolute path to crypt_shared shared library. Defaults to empty string and consults system paths.
+ cryptSharedLibRequired (bool): If &true;, require the driver to load crypt_shared. Defaults to &false;.
+
+
+ See the Client-Side Encryption Specification for more information.
+
+
+
+
+
+
+
+
+ Automatic encryption is an enterprise only feature that only
+ applies to operations on a collection. Automatic encryption is not
+ supported for operations on a database or view, and operations that
+ are not bypassed will result in error. To bypass automatic
+ encryption for all operations, set bypassAutoEncryption=true
+ in autoEncryption. For more information on
+ allowed operations, see the
+ Client-Side Encryption Specification.
+
+
+
+
+
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\RuntimeException if the uri format is invalid
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+
+ The "canonicalizeHostname" URI option was removed.
+ Use the "CANONICALIZE_HOST_NAME" property of the
+ "authMechanismProperties" URI option instead.
+
+
+ The "gssapiServiceName" URI option was removed.
+ Use the "SERVICE_NAME" property of the
+ "authMechanismProperties" URI option instead.
+
+
+ The "safe" URI option was removed. Use the
+ "w" and "wTimeoutMS" URI options
+ instead.
+
+
+ The "ssl" URI option was removed. Use the
+ "tls" URI option instead.
+
+
+ The "allow_invalid_hostname" driver option was
+ removed. Use the "tlsAllowInvalidHostnames" URI
+ option instead.
+
+
+ The "ca_file" driver option was removed. Use the
+ "tlsCAFile" URI option instead.
+
+
+ The "context" driver option was removed. All context
+ options were deprecated in favor of the various URI options related to
+ TLS.
+
+
+ The "pem_file" driver option was removed. Use the
+ "tlsCertificateKeyFile" URI option instead.
+
+
+ The "pem_pwd" driver option was removed. Use the
+ "tlsCertificateKeyFilePassword" URI option instead.
+
+
+ The "weak_cert_validation" driver option was removed.
+ Use the "tlsAllowInvalidCertificates" URI option
+ instead.
+
+
+
+
+ PECL mongodb 1.16.0
+
+
+ The AWS KMS provider for client-side encryption now accepts a
+ "sessionToken" option, which can be used to
+ authenticate with temporary AWS credentials.
+
+
+ Added "tlsDisableOCSPEndpointCheck" to the
+ "tlsOptions" field of the
+ "autoEncryption" driver option.
+
+
+ If an empty document is specified for the "azure" or
+ "gcp" KMS provider, the driver will attempt to
+ configure the provider using
+ Automatic Credentials.
+
+
+
+
+ PECL mongodb 1.15.0
+
+
+ If an empty document is specified for the "aws" KMS
+ provider, the driver will attempt to configure the provider using
+ Automatic Credentials.
+
+
+
+
+ PECL mongodb 1.14.0
+
+
+ Added the "bypassQueryAnalysis" and
+ "encryptedFieldsMap" auto encryption options.
+ Additional options pertaining to crypt_shared are
+ now supported in the "extraOptions" auto encryption
+ option.
+
+
+
+
+ PECL mongodb 1.13.0
+
+
+ Added the "srvMaxHosts" and
+ "srvServiceName" URI options.
+
+
+
+
+ PECL mongodb 1.12.0
+
+
+ KMIP is now supported as a KMS provider for client-side encryption and
+ may be configured in the "kmsProviders" field of the
+ "autoEncryption" driver option. Additionally, TLS
+ options for KMS providers may now be configured in the
+ "tlsOptions" field of the
+ "autoEncryption" driver option.
+
+
+
+
+ PECL mongodb 1.11.0
+
+
+ Added the "loadBalanced" URI option.
+
+
+
+
+ PECL mongodb 1.10.0
+
+
+ Added the "disableClientPersistence" driver option.
+
+
+ Azure and GCP are now supported as KMS providers for client-side
+ encryption and may be configured in the
+ "kmsProviders" field of the
+ "autoEncryption" driver option. Base64-encoded
+ strings are now accepted as an alternative to
+ MongoDB\BSON\Binary for options within
+ "kmsProviders".
+
+
+
+
+ PECL mongodb 1.8.0
+
+
+ Added the "directConnection",
+ "tlsDisableCertificateRevocationCheck", and
+ "tlsDisableOCSPEndpointCheck" URI options.
+
+
+ Added the "driver" driver option.
+
+
+
+
+ PECL mongodb 1.7.0
+
+
+ Added the "autoEncryption" driver option.
+
+
+ Specifying any SSL or TLS option via the driverOptions
+ parameter will now implicitly enable TLS, as is done for the
+ corresponding URI options.
+
+
+
+
+ PECL mongodb 1.6.0
+
+
+ Added the "retryReads", "tls",
+ "tlsAllowInvalidCertificates",
+ "tlsAllowInvalidHostnames",
+ "tlsCAFile",
+ "tlsCertificateKeyFile",
+ "tlsCertificateKeyFilePassword", and
+ "tlsInsecure" URI options.
+
+
+ The "retryWrites" URI option defaults to &true;.
+
+
+ Specifying any SSL or TLS URI option via the connection string or
+ uriOptions parameter will now implicitly enable
+ TLS unless ssl or tls is &false;.
+ TLS is not implicitly enabled for any options in
+ the driverOptions parameter, which is unchanged
+ from previous versions.
+
+
+
+
+ PECL mongodb 1.5.0
+
+
+ "wtimeoutMS" is now always validated and applied to
+ the write concern. Previously, the option was ignored if
+ "w" was <= 1, since the timeout only applies to
+ replication.
+
+
+
+
+ PECL mongodb 1.4.0
+
+
+ Added the "compressors",
+ "retryWrites", and
+ "zlibCompressionLevel" URI options.
+
+
+
+
+ PECL mongodb 1.3.0
+
+
+ The uriOptions argument now accepts
+ "authMechanism" and
+ "authMechanismProperties" options. Previously, these
+ options were only supported in the uri argument.
+
+
+
+
+ PECL mongodb 1.2.0
+
+
+ The uri argument defaults to
+ "mongodb://127.0.0.1/". The default port remains
+ 27017.
+
+
+ Added the "appname" URI option.
+
+
+ Added the "allow_invalid_hostname",
+ "ca_file", "ca_dir",
+ "clr_file", "pem_file",
+ "pem_pwd", and
+ "weak_cert_validation" driver options.
+
+
+ The PHP Streams API is no longer used for socket communication. The
+ "connectTimeoutMS" URI option now defaults to 10
+ seconds instead of
+ default_socket_timeout
+ in previous versions. Additionally, the extension no longer supports
+ all SSL context options via the
+ "context" driver option.
+
+
+
+
+ PECL mongodb 1.1.0
+
+
+ The uri argument is optional and defaults to
+ "mongodb://localhost:27017/".
+
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Manager::__construct basic examples
+ Connecting to standalone MongoDB node:
+
+
+]]>
+
+
+ Connecting to standalone MongoDB node via a Unix domain socket. The socket
+ path may include special characters such as slashes and should be encoded
+ with rawurlencode.
+
+
+
+]]>
+
+ Connecting to a replica set:
+
+
+]]>
+
+ Connecting to a sharded cluster (i.e. one or more mongos instances):
+
+
+]]>
+
+ Connecting to MongoDB with authentication credentials for a particular user and database:
+
+
+]]>
+
+
+
+ Connecting to MongoDB with authentication credentials for a particular
+ user and database, where the username or password includes special
+ characters (e.g. @, :,
+ %). In the following example, the password string
+ myp@ss:w%rd has been manually escaped; however,
+ rawurlencode may also be used to escape URI components
+ that may contain special characters.
+
+
+
+]]>
+
+
+ Connecting to MongoDB with X509 authentication:
+
+ "/path/to/client.pem",
+ ]
+);
+?>
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ Connection handling and persistence
+ MongoDB Connection String Format
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/createclientencryption.xml b/reference/mongodb/mongodb/driver/manager/createclientencryption.xml
new file mode 100644
index 0000000000..96f05aa741
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/createclientencryption.xml
@@ -0,0 +1,167 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::createClientEncryption
+ 新しい ClientEncryption object を作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ClientEncryptionMongoDB\Driver\Manager::createClientEncryption
+ arrayoptions
+
+
+ Constructs a new MongoDB\Driver\ClientEncryption object with the specified options.
+
+
+
+
+ &reftitle.parameters;
+
+
+ options
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a new MongoDB\Driver\ClientEncryption instance.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\RuntimeException if the extension was compiled without libmongocrypt support
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.16.0
+
+
+ The AWS KMS provider for client-side encryption now accepts a
+ "sessionToken" option, which can be used to
+ authenticate with temporary AWS credentials.
+
+
+ Added "tlsDisableOCSPEndpointCheck" to the
+ "tlsOptions" option.
+
+
+ If an empty document is specified for the "azure" or
+ "gcp" KMS provider, the driver will attempt to
+ configure the provider using
+ Automatic Credentials.
+
+
+
+
+ PECL mongodb 1.15.0
+
+
+ If an empty document is specified for the "aws" KMS
+ provider, the driver will attempt to configure the provider using
+ Automatic Credentials.
+
+
+
+
+ PECL mongodb 1.12.0
+
+
+ KMIP is now supported as a KMS provider for client-side encryption and
+ may be configured in the "kmsProviders" option.
+
+
+ Added the "tlsOptions" option.
+
+
+
+
+ PECL mongodb 1.10.0
+
+ Azure and GCP are now supported as KMS providers for client-side
+ encryption and may be configured in the
+ "kmsProviders" option. Base64-encoded strings are now
+ accepted as an alternative to MongoDB\BSON\Binary
+ for options within "kmsProviders".
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ClientEncryption::__construct
+ Explicit (Manual) Client-Side Field Level Encryption in the MongoDB manual
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/executebulkwrite.xml b/reference/mongodb/mongodb/driver/manager/executebulkwrite.xml
new file mode 100644
index 0000000000..20409e75a0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/executebulkwrite.xml
@@ -0,0 +1,239 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::executeBulkWrite
+ 1つ以上の書き込み操作を実行する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\WriteResultMongoDB\Driver\Manager::executeBulkWrite
+ stringnamespace
+ MongoDB\Driver\BulkWritebulk
+ arraynulloptions&null;
+
+
+ Executes one or more write operations on the primary server.
+
+
+ A MongoDB\Driver\BulkWrite can be constructed with
+ one or more write operations of varying types (e.g. updates, deletes, and
+ inserts). The driver will attempt to send operations of the same type to the
+ server in as few requests as possible to optimize round trips.
+
+
+ The default value for the "writeConcern" option will be
+ inferred from an active transaction (indicated by the
+ "session" option), followed by the
+ connection URI.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.namespace;
+ &mongodb.parameter.bulkwrite;
+
+ options
+
+
+
+
+ &mongodb.option.transactionReadWriteConcern;
+
+
+
+
+
+
+ &reftitle.returnvalues;
+ &mongodb.returns.cursor;
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.session-readwriteconcern;
+ &mongodb.throws.session-unacknowledged;
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors (e.g. invalid command, issuing a write command to a secondary).
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+ The options parameter no longer accepts a
+ MongoDB\Driver\ReadPreference instance.
+
+
+
+ PECL mongodb 1.21.0
+
+ Passing a MongoDB\Driver\ReadPreference object as
+ options is deprecated and will be removed in 2.0.
+
+
+
+ PECL mongodb 1.4.4
+
+ MongoDB\Driver\Exception\InvalidArgumentException
+ will be thrown if the "session" option is used in
+ combination with an unacknowledged write concern.
+
+
+
+ PECL mongodb 1.4.0
+
+ The third parameter is now an options array.
+ For backwards compatibility, this paramater will still accept a
+ MongoDB\Driver\ReadPreference object.
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Manager::executeCommand with a command returning a single result document
+
+ 1]);
+
+try {
+ $cursor = $manager->executeCommand('admin', $command);
+} catch(MongoDB\Driver\Exception $e) {
+ echo $e->getMessage(), "\n";
+ exit;
+}
+
+/* The ping command returns a single result document, so we need to access the
+ * first result in the cursor. */
+$response = $cursor->toArray()[0];
+
+var_dump($response);
+
+?>
+]]>
+
+ &example.outputs;
+
+
+ float(1)
+}
+]]>
+
+
+
+ MongoDB\Driver\Manager::executeCommand with a command returning a cursor
+
+insert(['x' => 1, 'y' => 'foo']);
+$bulk->insert(['x' => 2, 'y' => 'bar']);
+$bulk->insert(['x' => 3, 'y' => 'bar']);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$command = new MongoDB\Driver\Command([
+ 'aggregate' => 'collection',
+ 'pipeline' => [
+ ['$group' => ['_id' => '$y', 'sum' => ['$sum' => '$x']]],
+ ],
+ 'cursor' => new stdClass,
+]);
+$cursor = $manager->executeCommand('db', $command);
+
+/* The aggregate command can optionally return its results in a cursor instead
+ * of a single result document. In this case, we can iterate on the cursor
+ * directly to access those results. */
+foreach ($cursor as $document) {
+ var_dump($document);
+}
+
+?>
+]]>
+
+ &example.outputs;
+
+
+ string(3) "bar"
+ ["sum"]=>
+ int(10)
+}
+object(stdClass)#7 (2) {
+ ["_id"]=>
+ string(3) "foo"
+ ["sum"]=>
+ int(2)
+}
+]]>
+
+
+
+
+ Limiting execution time for a command
+
+ The execution time of a command may be limited by specifying a value for
+ "maxTimeMS" in the
+ MongoDB\Driver\Command document. Note that this time
+ limit is enforced on the server side and does not take network latency into
+ account. See
+ Terminate Running Operations
+ in the MongoDB manual for more information.
+
+
+ 'collection',
+ 'query' => ['x' => ['$gt' => 1]],
+ 'maxTimeMS' => 1000,
+]);
+
+$cursor = $manager->executeCommand('db', $command);
+
+var_dump($cursor->toArray()[0]);
+
+?>
+]]>
+
+
+ If the command fails to complete after one second of execution time on the
+ server, a
+ MongoDB\Driver\Exception\ExecutionTimeoutException
+ will be thrown.
+
+
+
+
+
+ &reftitle.notes;
+
+
+ If a secondary readPreference is used, it is the
+ caller's responsibility to ensure that the
+ command can be executed on a secondary. No validation
+ is done by the driver.
+
+
+
+
+ This method does not default to using the read preference from the
+ MongoDB Connection
+ URI. Applications in need of that behavior should consider using
+ MongoDB\Driver\Manager::executeReadCommand.
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Command
+ MongoDB\Driver\Cursor
+ MongoDB\Driver\Manager::executeReadCommand
+ MongoDB\Driver\Manager::executeReadWriteCommand
+ MongoDB\Driver\Manager::executeWriteCommand
+ MongoDB\Driver\Server::executeCommand
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/executequery.xml b/reference/mongodb/mongodb/driver/manager/executequery.xml
new file mode 100644
index 0000000000..2426673bc2
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/executequery.xml
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::executeQuery
+ データベースクエリを実行する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\CursorMongoDB\Driver\Manager::executeQuery
+ stringnamespace
+ MongoDB\Driver\Queryquery
+ arraynulloptions&null;
+
+
+ Selects a server according to the "readPreference" option
+ and executes the query on that server.
+
+
+ Default values for the "readPreference" option and Query's
+ "readConcern" option will be inferred from an active
+ transaction (indicated by the "session" option), followed
+ by the connection URI.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.namespace;
+ &mongodb.parameter.query;
+
+ options
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+ &mongodb.returns.cursor;
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors (e.g. invalid query operators).
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+ The options parameter no longer accepts a
+ MongoDB\Driver\ReadPreference instance.
+
+
+
+ PECL mongodb 1.21.0
+
+ Passing a MongoDB\Driver\ReadPreference object as
+ options is deprecated and will be removed in 2.0.
+
+
+
+ PECL mongodb 1.4.0
+
+ The third parameter is now an options array.
+ For backwards compatibility, this paramater will still accept a
+ MongoDB\Driver\ReadPreference object.
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Manager::executeQuery の例
+
+insert(['x' => 1]);
+$bulk->insert(['x' => 2]);
+$bulk->insert(['x' => 3]);
+$manager->executeBulkWrite('db.collection', $bulk);
+
+$filter = ['x' => ['$gt' => 1]];
+$options = [
+ 'projection' => ['_id' => 0],
+ 'sort' => ['x' => -1],
+];
+
+$query = new MongoDB\Driver\Query($filter, $options);
+$cursor = $manager->executeQuery('db.collection', $query);
+
+foreach ($cursor as $document) {
+ var_dump($document);
+}
+
+?>
+]]>
+
+ &example.outputs;
+
+
+ int(3)
+}
+object(stdClass)#7 (1) {
+ ["x"]=>
+ int(2)
+}
+]]>
+
+
+
+
+ Limiting execution time for a query
+
+ The "maxTimeMS"
+ MongoDB\Driver\Query option may be used to limit the
+ execution time of a query. Note that this time limit is enforced on the
+ server side and does not take network latency into account. See
+ Terminate Running Operations
+ in the MongoDB manual for more information.
+
+
+ ['$gt' => 1]];
+$options = [
+ 'maxTimeMS' => 1000,
+];
+
+$query = new MongoDB\Driver\Query($filter, $options);
+$cursor = $manager->executeQuery('db.collection', $query);
+
+foreach ($cursor as $document) {
+ var_dump($document);
+}
+
+?>
+]]>
+
+
+ If the query fails to complete after one second of execution time on the
+ server, a
+ MongoDB\Driver\Exception\ExecutionTimeoutException
+ will be thrown.
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Cursor
+ MongoDB\Driver\Query
+ MongoDB\Driver\ReadPreference
+ MongoDB\Driver\Server::executeQuery
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/executereadcommand.xml b/reference/mongodb/mongodb/driver/manager/executereadcommand.xml
new file mode 100644
index 0000000000..db6c629a8c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/executereadcommand.xml
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::executeReadCommand
+ 読み取りを行うデータベースコマンドを実行する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\CursorMongoDB\Driver\Manager::executeReadCommand
+ stringdb
+ MongoDB\Driver\Commandcommand
+ arraynulloptions&null;
+
+
+ Selects a server according to the "readPreference" option
+ and executes the command on that server.
+
+
+ This method will apply logic that is specific to commands that read (e.g.
+ distinct).
+ Default values for the "readPreference" and
+ "readConcern" options will be inferred from an active
+ transaction (indicated by the "session" option), followed
+ by the connection URI.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.db;
+ &mongodb.parameter.command;
+
+ options
+
+
+
+
+ &mongodb.option.transactionReadWriteConcern;
+
+
+
+
+
+
+ &reftitle.returnvalues;
+ &mongodb.returns.cursor;
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.session-readwriteconcern;
+ &mongodb.throws.session-unacknowledged;
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors (e.g. invalid command).
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.4.4
+
+ MongoDB\Driver\Exception\InvalidArgumentException
+ will be thrown if the "session" option is used in
+ combination with an unacknowledged write concern.
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Command
+ MongoDB\Driver\Cursor
+ MongoDB\Driver\Manager::executeCommand
+ MongoDB\Driver\Manager::executeReadCommand
+ MongoDB\Driver\Manager::executeReadWriteCommand
+ MongoDB\Driver\Server::executeWriteCommand
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/getencryptedfieldsmap.xml b/reference/mongodb/mongodb/driver/manager/getencryptedfieldsmap.xml
new file mode 100644
index 0000000000..360a6f7eac
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/getencryptedfieldsmap.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::getEncryptedFieldsMap
+ encryptedFieldsMap auto encryption option for the Manager を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayobjectnullMongoDB\Driver\Manager::getEncryptedFieldsMap
+
+
+
+ Returns the encryptedFieldsMap auto encryption option for
+ the Manager, if specified.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ The encryptedFieldsMap auto encryption option for the
+ Manager, or &null; if it was not specified.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::__construct
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/getreadconcern.xml b/reference/mongodb/mongodb/driver/manager/getreadconcern.xml
new file mode 100644
index 0000000000..9026ca971c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/getreadconcern.xml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::getReadConcern
+ ReadConcern for the Manager を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ReadConcernMongoDB\Driver\Manager::getReadConcern
+
+
+
+ Returns the MongoDB\Driver\ReadConcern for the
+ Manager, which is derived from its URI options. This is the default read
+ concern for queries and commands executed on the Manager.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ The MongoDB\Driver\ReadConcern for the Manager.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Manager::getReadConcern の例
+
+getReadConcern());
+
+$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017/?readConcernLevel=local');
+var_dump($manager->getReadConcern());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(5) "local"
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ReadConcern
+ MongoDB\Driver\Manager::__construct
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/getreadpreference.xml b/reference/mongodb/mongodb/driver/manager/getreadpreference.xml
new file mode 100644
index 0000000000..625a3f62c3
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/getreadpreference.xml
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::getReadPreference
+ ReadPreference for the Manager を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ReadPreferenceMongoDB\Driver\Manager::getReadPreference
+
+
+
+ Returns the MongoDB\Driver\ReadPreference for the
+ Manager, which is derived from its URI options. This is the default read
+ preference for queries and commands executed on the Manager.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ The MongoDB\Driver\ReadPreference for the Manager.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Manager::getReadPreference の例
+
+getReadPreference());
+
+$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017/?readPreference=secondaryPreferred&readPreferenceTags=dc:ny,rack:1&readPreferenceTags=dc:ny&readPreferenceTags=');
+var_dump($manager->getReadPreference());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(7) "primary"
+}
+object(MongoDB\Driver\ReadPreference)#1 (2) {
+ ["mode"]=>
+ string(18) "secondaryPreferred"
+ ["tags"]=>
+ array(3) {
+ [0]=>
+ object(stdClass)#3 (2) {
+ ["dc"]=>
+ string(2) "ny"
+ ["rack"]=>
+ string(1) "1"
+ }
+ [1]=>
+ object(stdClass)#4 (1) {
+ ["dc"]=>
+ string(2) "ny"
+ }
+ [2]=>
+ object(stdClass)#5 (0) {
+ }
+ }
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ReadPreference
+ MongoDB\Driver\Manager::__construct
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/getservers.xml b/reference/mongodb/mongodb/driver/manager/getservers.xml
new file mode 100644
index 0000000000..e24f88c1fd
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/getservers.xml
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::getServers
+ servers to which this manager is connected を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\Manager::getServers
+
+
+
+ Returns an array of MongoDB\Driver\Server
+ instances to which this manager is connected.
+
+
+
+ Since the driver connects to the database lazily, this method may return an
+ empty array if called before executing an operation on the
+ MongoDB\Driver\Manager.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array of MongoDB\Driver\Server
+ instances to which this manager is connected.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Manager::getServers の例
+
+getServers());
+
+$command = new MongoDB\Driver\Command(['ping' => 1]);
+$manager->executeCommand('db', $command);
+
+var_dump($manager->getServers());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\Driver\Server)#3 (10) {
+ ["host"]=>
+ string(9) "localhost"
+ ["port"]=>
+ int(27017)
+ ["type"]=>
+ int(1)
+ ["is_primary"]=>
+ bool(false)
+ ["is_secondary"]=>
+ bool(false)
+ ["is_arbiter"]=>
+ bool(false)
+ ["is_hidden"]=>
+ bool(false)
+ ["is_passive"]=>
+ bool(false)
+ ["last_hello_response"]=>
+ array(8) {
+ ["isWritablePrimary"]=>
+ bool(true)
+ ["maxBsonObjectSize"]=>
+ int(16777216)
+ ["maxMessageSizeBytes"]=>
+ int(48000000)
+ ["maxWriteBatchSize"]=>
+ int(1000)
+ ["localTime"]=>
+ object(MongoDB\BSON\UTCDateTime)#4 (1) {
+ ["milliseconds"]=>
+ int(1447267964517)
+ }
+ ["maxWireVersion"]=>
+ int(3)
+ ["minWireVersion"]=>
+ int(0)
+ ["ok"]=>
+ float(1)
+ }
+ ["round_trip_time"]=>
+ int(554)
+ }
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server
+ MongoDB\Driver\Manager::selectServer
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/getwriteconcern.xml b/reference/mongodb/mongodb/driver/manager/getwriteconcern.xml
new file mode 100644
index 0000000000..86dfdde884
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/getwriteconcern.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::getWriteConcern
+ WriteConcern for the Manager を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\WriteConcernMongoDB\Driver\Manager::getWriteConcern
+
+
+
+ Returns the MongoDB\Driver\WriteConcern for the
+ Manager, which is derived from its URI options. This is the default write
+ concern for writes and commands executed on the Manager.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ The MongoDB\Driver\WriteConcern for the Manager.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Manager::getWriteConcern の例
+
+getWriteConcern());
+
+$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017/?w=majority&wtimeoutMS=2000');
+var_dump($manager->getWriteConcern());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(8) "majority"
+ ["wtimeout"]=>
+ int(2000)
+}
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteConcern
+ MongoDB\Driver\Manager::__construct
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/removesubscriber.xml b/reference/mongodb/mongodb/driver/manager/removesubscriber.xml
new file mode 100644
index 0000000000..17f6a9d2ab
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/removesubscriber.xml
@@ -0,0 +1,88 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::removeSubscriber
+ この Manager のモニタリングイベントサブスクライバーを解除する
+
+
+
+ &reftitle.description;
+
+ finalpublicvoidMongoDB\Driver\Manager::removeSubscriber
+ MongoDB\Driver\Monitoring\Subscribersubscriber
+
+
+ Unregisters a monitoring event subscriber with this Manager.
+
+
+
+ If subscriber is not already registered with this
+ Manager, this function is a no-op.
+
+
+
+
+
+ &reftitle.parameters;
+
+
+ subscriber (MongoDB\Driver\Monitoring\Subscriber)
+
+
+ A monitoring event subscriber to unregister with this Manager.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::addSubscriber
+ MongoDB\Driver\Monitoring\Subscriber
+ MongoDB\Driver\Monitoring\CommandSubscriber
+ MongoDB\Driver\Monitoring\removeSubscriber
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/selectserver.xml b/reference/mongodb/mongodb/driver/manager/selectserver.xml
new file mode 100644
index 0000000000..7bcd9997a0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/selectserver.xml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::selectServer
+ 読み込み設定に一致するサーバーを選択する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerMongoDB\Driver\Manager::selectServer
+ MongoDB\Driver\ReadPreferencenullreadPreference&null;
+
+
+ Selects a MongoDB\Driver\Server matching
+ readPreference. If
+ readPreference is &null; or omitted, the primary
+ server will be selected by default. This may be used to preselect a server in
+ order to perform version checking before executing an operation.
+
+
+
+ Unlike MongoDB\Driver\Manager::getServers, this method
+ will initialize database connections and perform server discovery if
+ necessary. See the
+ Server Selection Specification
+ for additional information.
+
+
+
+
+
+ &reftitle.parameters;
+
+
+ readPreference (MongoDB\Driver\ReadPreference)
+
+
+ The read preference to use for selecting a server. If &null; or omitted,
+ the primary server will be selected by default.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a MongoDB\Driver\Server matching the read
+ preference.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException if a server matching the read preference could not be found.
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.11.0
+
+ The readPreference is now optional. If &null; or
+ omitted, the primary server will be selected by default.
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server
+ MongoDB\Driver\Manager::getServers
+ Server Selection Specification
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/manager/startsession.xml b/reference/mongodb/mongodb/driver/manager/startsession.xml
new file mode 100644
index 0000000000..3d6dcdab21
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/manager/startsession.xml
@@ -0,0 +1,225 @@
+
+
+
+
+
+
+ MongoDB\Driver\Manager::startSession
+ このクライアントで使用する新しいクライアントセッションを開始する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\SessionMongoDB\Driver\Manager::startSession
+ arraynulloptions&null;
+
+
+ Creates a MongoDB\Driver\Session for the given
+ options. The session may then be specified when executing commands, queries,
+ and write operations.
+
+
+
+ A MongoDB\Driver\Session can only be used with the
+ MongoDB\Driver\Manager from which it was created.
+
+
+
+
+
+ &reftitle.parameters;
+
+
+ options
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+ Default
+
+
+
+
+ causalConsistency
+ bool
+
+
+ Configure causal consistency in a session. If &true;, each operation
+ in the session will be causally ordered after the previous read or
+ write operation. Set to &false; to disable causal consistency.
+
+
+ See
+ Casual Consistency
+ in the MongoDB manual for more information.
+
+
+ &true;
+
+
+ defaultTransactionOptions
+ array
+
+
+ Default options to apply to newly created transactions. These
+ options are used unless they are overridden when a transaction is
+ started with different value for each option.
+
+
+
+
+
+ This option is available in MongoDB 4.0+.
+
+
+ []
+
+
+ snapshot
+ bool
+
+
+ Configure snapshot reads in a session. If &true;, a timestamp will
+ be obtained from the first supported read operation in the session
+ (i.e. find, aggregate, or
+ unsharded distinct). Subsequent read operations
+ within the session will then utilize a "snapshot"
+ read concern level to read majority-committed data from that
+ timestamp. Set to &false; to disable snapshot reads.
+
+
+ Snapshot reads require MongoDB 5.0+ and cannot be used with causal
+ consistency, transactions, or write operations. If
+ "snapshot" is &true;,
+ "causalConsistency" will default to &false;.
+
+
+ See
+ Read Concern "snapshot"
+ in the MongoDB manual for more information.
+
+
+ &false;
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a MongoDB\Driver\Session.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\InvalidArgumentException if the "causalConsistency" and "snapshot" options are both &true;.
+ Throws MongoDB\Driver\Exception\RuntimeException if the session could not be created (e.g. libmongoc does not support crypto).
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.11.0
+
+
+ The "snapshot" option was added.
+
+
+
+
+ PECL mongodb 1.6.0
+
+
+ The "maxCommitTimeMS" option was added to
+ "defaultTransactionOptions".
+
+
+
+
+ PECL mongodb 1.5.0
+
+
+ The "defaultTransactionOptions" option was added.
+
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Session
+ Casual Consistency in the MongoDB manual
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent.xml
new file mode 100644
index 0000000000..b2df11939d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent クラス
+ MongoDB\Driver\Monitoring\CommandFailedEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\CommandFailedEvent
+ class encapsulates information about a failed command.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.commandfailedevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getcommandname.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getcommandname.xml
new file mode 100644
index 0000000000..06d71ff85e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getcommandname.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getCommandName
+ command name を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandFailedEvent::getCommandName
+
+
+
+ Returns the command name (e.g. "find",
+ "aggregate").
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command name.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getdatabasename.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getdatabasename.xml
new file mode 100644
index 0000000000..79963cfac1
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getdatabasename.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getDatabaseName
+ database on which the command was executed を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandFailedEvent::getDatabaseName
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the database on which the command was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getdurationmicros.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getdurationmicros.xml
new file mode 100644
index 0000000000..2081313dec
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getdurationmicros.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getDurationMicros
+ command's duration in microseconds を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\CommandFailedEvent::getDurationMicros
+
+
+
+ The command's duration is a calculated value that includes the time to send
+ the message and receive the reply from the server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command's duration in microseconds.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/geterror.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/geterror.xml
new file mode 100644
index 0000000000..f6554e06f7
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/geterror.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getError
+ Exception associated with the failed command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicExceptionMongoDB\Driver\Monitoring\CommandFailedEvent::getError
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the Exception associated with the failed command.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/gethost.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/gethost.xml
new file mode 100644
index 0000000000..2c72f0d098
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/gethost.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getHost
+ server hostname for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandFailedEvent::getHost
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of the server on which the command was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getoperationid.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getoperationid.xml
new file mode 100644
index 0000000000..e1502da23c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getoperationid.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getOperationId
+ command's operation ID を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandFailedEvent::getOperationId
+
+
+
+ The operation ID is generated by the extension and may be used to link events
+ together such as bulk write operations, which may have been split across
+ several commands at the protocol level.
+
+
+
+ Since multiple commands may share the same operation ID, it is not reliable
+ to use this value to associate event objects with each other. The request ID
+ returned by
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getRequestId
+ should be used instead.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command's operation ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getRequestId
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getport.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getport.xml
new file mode 100644
index 0000000000..37be959cb4
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getport.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getPort
+ server port for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\CommandFailedEvent::getPort
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port of the server on which the command was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getreply.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getreply.xml
new file mode 100644
index 0000000000..b372dfdc99
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getreply.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getReply
+ command reply document を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectMongoDB\Driver\Monitoring\CommandFailedEvent::getReply
+
+
+
+ The reply document will be converted from BSON to PHP using the default
+ deserialization
+ rules (e.g. BSON documents will be converted to stdClass).
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command reply document as a stdClass
+ object.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getrequestid.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getrequestid.xml
new file mode 100644
index 0000000000..49bb4e6520
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getrequestid.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getRequestId
+ command's request ID を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandFailedEvent::getRequestId
+
+
+
+ The request ID is generated by the extension and may be used to associate
+ this MongoDB\Driver\Monitoring\CommandFailedEvent with
+ a previous
+ MongoDB\Driver\Monitoring\CommandStartedEvent.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command's request ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserver.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserver.xml
new file mode 100644
index 0000000000..11eeae8bc7
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserver.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getServer
+ Server on which the command was executed を返す
+
+
+
+
+
+ This method has been DEPRECATED as of extension
+ version 1.20.0 and was removed in 2.0. Applications should use
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getHost
+ and
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getPort
+ instead.
+
+
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerMongoDB\Driver\Monitoring\CommandFailedEvent::getServer
+
+
+
+ Returns the MongoDB\Driver\Server on which the command
+ was executed.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the MongoDB\Driver\Server on which the command
+ was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.method-removed;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getServer
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserverconnectionid.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserverconnectionid.xml
new file mode 100644
index 0000000000..a8d71510ea
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserverconnectionid.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getServerConnectionId
+ server connection ID for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintnullMongoDB\Driver\Monitoring\CommandFailedEvent::getServerConnectionId
+
+
+
+ Returns the server connection ID for the command. The server connection ID is
+ distinct from server (i.e.
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getServer)
+ and is returned in the "connectionId" field of a hello
+ command response MongoDB 4.2+.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the server connection ID, or &null; if it is not available.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserviceid.xml b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserviceid.xml
new file mode 100644
index 0000000000..a55393df8c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserviceid.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getServiceId
+ load balancer service ID for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\ObjectIdnullMongoDB\Driver\Monitoring\CommandFailedEvent::getServiceId
+
+
+
+ When the driver is connected to a MongoDB cluster through a load balancer,
+ the service ID corresponds to the serviceId field in the
+ hello command response.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the load balancer service ID, or &null; if the driver is not
+ connected to a load balancer.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent.xml
new file mode 100644
index 0000000000..e883c5cc6b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent クラス
+ MongoDB\Driver\Monitoring\CommandStartedEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\CommandStartedEvent
+ class encapsulates information about a started command.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.commandstartedevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getcommand.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getcommand.xml
new file mode 100644
index 0000000000..a7ec91a9f0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getcommand.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getCommand
+ command document を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectMongoDB\Driver\Monitoring\CommandStartedEvent::getCommand
+
+
+
+ The reply document will be converted from BSON to PHP using the default
+ deserialization
+ rules (e.g. BSON documents will be converted to stdClass).
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command document as a stdClass object.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getcommandname.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getcommandname.xml
new file mode 100644
index 0000000000..ca7097462f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getcommandname.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getCommandName
+ command name を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandStartedEvent::getCommandName
+
+
+
+ Returns the command name (e.g. "find",
+ "aggregate").
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command name.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getdatabasename.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getdatabasename.xml
new file mode 100644
index 0000000000..bac98e072d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getdatabasename.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getDatabaseName
+ database on which the command was executed を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandStartedEvent::getDatabaseName
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the database on which the command was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/gethost.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/gethost.xml
new file mode 100644
index 0000000000..c039e749a2
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/gethost.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getHost
+ server hostname for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandStartedEvent::getHost
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of the server on which the command was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getoperationid.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getoperationid.xml
new file mode 100644
index 0000000000..43f76885e2
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getoperationid.xml
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId
+ command's operation ID を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId
+
+
+
+ The operation ID is generated by the extension and may be used to link events
+ together such as bulk write operations, which may have been split across
+ several commands at the protocol level.
+
+
+
+ Since multiple commands may share the same operation ID, it is not reliable
+ to use this value to associate event objects with each other. The request ID
+ returned by
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId
+ should be used instead.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command's operation ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getOperationId
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getOperationId
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getport.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getport.xml
new file mode 100644
index 0000000000..41a4c36db3
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getport.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getPort
+ server port for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\CommandStartedEvent::getPort
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port of the server on which the command was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getrequestid.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getrequestid.xml
new file mode 100644
index 0000000000..27d1001f26
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getrequestid.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId
+ command's request ID を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId
+
+
+
+ The request ID is generated by the extension and may be used to associate
+ this MongoDB\Driver\Monitoring\CommandStartedEvent
+ with a later
+ MongoDB\Driver\Monitoring\CommandFailedEvent or
+ MongoDB\Driver\Monitoring\CommandSucceededEvent.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command's request ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getRequestId
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserver.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserver.xml
new file mode 100644
index 0000000000..2bd6eea1b0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserver.xml
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getServer
+ Server on which the command was executed を返す
+
+
+
+
+
+ This method has been DEPRECATED as of extension
+ version 1.20.0 and was removed in 2.0. Applications should use
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getHost
+ and
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getPort
+ instead.
+
+
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerMongoDB\Driver\Monitoring\CommandStartedEvent::getServer
+
+
+
+ Returns the MongoDB\Driver\Server on which the command
+ was executed.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the MongoDB\Driver\Server on which the command
+ was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.method-removed;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent::getServer
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getServer
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserverconnectionid.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserverconnectionid.xml
new file mode 100644
index 0000000000..23c358ea47
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserverconnectionid.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getServerConnectionId
+ server connection ID for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintnullMongoDB\Driver\Monitoring\CommandStartedEvent::getServerConnectionId
+
+
+
+ Returns the server connection ID for the command. The server connection ID is
+ distinct from server (i.e.
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getServer)
+ and is returned in the "connectionId" field of a hello
+ command response MongoDB 4.2+.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the server connection ID, or &null; if it is not available.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserviceid.xml b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserviceid.xml
new file mode 100644
index 0000000000..52959e4c0c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserviceid.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getServiceId
+ load balancer service ID for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\ObjectIdnullMongoDB\Driver\Monitoring\CommandStartedEvent::getServiceId
+
+
+
+ When the driver is connected to a MongoDB cluster through a load balancer,
+ the service ID corresponds to the serviceId field in the
+ hello command response.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the load balancer service ID, or &null; if the driver is not
+ connected to a load balancer.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsubscriber.xml b/reference/mongodb/mongodb/driver/monitoring/commandsubscriber.xml
new file mode 100644
index 0000000000..67c6b8e6e9
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsubscriber.xml
@@ -0,0 +1,93 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSubscriber インターフェイス
+ MongoDB\Driver\Monitoring\CommandSubscriber
+
+
+
+
+
+ &reftitle.intro;
+
+ Classes may implement this interface to register an event subscriber that is
+ notified for each started, successful, and failed command event. See
+ for additional information.
+
+
+
+
+
+ &reftitle.interfacesynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\CommandSubscriber
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSubscriber
+
+
+
+ MongoDB\Driver\Monitoring\Subscriber
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.tentative-return-types-enforced;
+ &mongodb.changelog.tentative-return-types;
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.commandsubscriber;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandfailed.xml b/reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandfailed.xml
new file mode 100644
index 0000000000..f23c694c14
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandfailed.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSubscriber::commandFailed
+ コマンドの失敗を通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\CommandSubscriber::commandFailed
+ MongoDB\Driver\Monitoring\CommandFailedEventevent
+
+
+ If the subscriber is registered, this method is called when a command fails.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\CommandFailedEvent)
+
+
+ An event object encapsulating information about the failed command.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandFailedEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandstarted.xml b/reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandstarted.xml
new file mode 100644
index 0000000000..72dfa53b76
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandstarted.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSubscriber::commandStarted
+ コマンドの開始を通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\CommandSubscriber::commandStarted
+ MongoDB\Driver\Monitoring\CommandStartedEventevent
+
+
+ If the subscriber is registered, this method is called when a command is sent
+ to the server.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\CommandStartedEvent)
+
+
+ An event object encapsulating information about the started command.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandsucceeded.xml b/reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandsucceeded.xml
new file mode 100644
index 0000000000..305d349641
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandsucceeded.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSubscriber::commandSucceeded
+ コマンドの成功を通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\CommandSubscriber::commandSucceeded
+ MongoDB\Driver\Monitoring\CommandSucceededEventevent
+
+
+ If the subscriber is registered, this method is called when a command
+ succeeds.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\CommandSucceededEvent)
+
+
+ An event object encapsulating information about the successful command.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent.xml
new file mode 100644
index 0000000000..c89b88b0cf
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent クラス
+ MongoDB\Driver\Monitoring\CommandSucceededEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\CommandSucceededEvent
+ class encapsulates information about a successful command.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.commandsucceededevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getcommandname.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getcommandname.xml
new file mode 100644
index 0000000000..2c64b6396b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getcommandname.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getCommandName
+ command name を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandSucceededEvent::getCommandName
+
+
+
+ Returns the command name (e.g. "find",
+ "aggregate").
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command name.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getdatabasename.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getdatabasename.xml
new file mode 100644
index 0000000000..013b38600a
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getdatabasename.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getDatabaseName
+ database on which the command was executed を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandSucceededEvent::getDatabaseName
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the database on which the command was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getdurationmicros.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getdurationmicros.xml
new file mode 100644
index 0000000000..b1571c4ca8
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getdurationmicros.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getDurationMicros
+ command's duration in microseconds を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\CommandSucceededEvent::getDurationMicros
+
+
+
+ The command's duration is a calculated value that includes the time to send
+ the message and receive the reply from the server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command's duration in microseconds.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/gethost.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/gethost.xml
new file mode 100644
index 0000000000..1b90e49ccb
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/gethost.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getHost
+ server hostname for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandSucceededEvent::getHost
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of the server on which the command was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getoperationid.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getoperationid.xml
new file mode 100644
index 0000000000..aa93548563
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getoperationid.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getOperationId
+ command's operation ID を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandSucceededEvent::getOperationId
+
+
+
+ The operation ID is generated by the extension and may be used to link events
+ together such as bulk write operations, which may have been split across
+ several commands at the protocol level.
+
+
+
+ Since multiple commands may share the same operation ID, it is not reliable
+ to use this value to associate event objects with each other. The request ID
+ returned by
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId
+ should be used instead.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command's operation ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getOperationId
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getport.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getport.xml
new file mode 100644
index 0000000000..6e5825151d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getport.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getPort
+ server port for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\CommandSucceededEvent::getPort
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port of the server on which the command was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getreply.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getreply.xml
new file mode 100644
index 0000000000..1b3403e2a7
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getreply.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getReply
+ command reply document を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectMongoDB\Driver\Monitoring\CommandSucceededEvent::getReply
+
+
+
+ The reply document will be converted from BSON to PHP using the default
+ deserialization
+ rules (e.g. BSON documents will be converted to stdClass).
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command reply document as a stdClass
+ object.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getrequestid.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getrequestid.xml
new file mode 100644
index 0000000000..b618564e3a
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getrequestid.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId
+ command's request ID を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\CommandSucceededEvent::getRequestId
+
+
+
+ The request ID is generated by the extension and may be used to associate
+ this MongoDB\Driver\Monitoring\CommandSucceededEvent
+ with a previous
+ MongoDB\Driver\Monitoring\CommandStartedEvent.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the command's request ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getRequestId
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserver.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserver.xml
new file mode 100644
index 0000000000..97998777b3
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserver.xml
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getServer
+ Server on which the command was executed を返す
+
+
+
+
+
+ This method has been DEPRECATED as of extension
+ version 1.20.0 and was removed in 2.0. Applications should use
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getHost
+ and
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getPort
+ instead.
+
+
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerMongoDB\Driver\Monitoring\CommandSucceededEvent::getServer
+
+
+
+ Returns the MongoDB\Driver\Server on which the command
+ was executed.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the MongoDB\Driver\Server on which the command
+ was executed.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.method-removed;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\CommandStartedEvent::getServer
+ MongoDB\Driver\Cursor::getServer
+ MongoDB\Driver\WriteResult::getServer
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserverconnectionid.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserverconnectionid.xml
new file mode 100644
index 0000000000..20f9817b23
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserverconnectionid.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getServerConnectionId
+ server connection ID for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintnullMongoDB\Driver\Monitoring\CommandSucceededEvent::getServerConnectionId
+
+
+
+ Returns the server connection ID for the command. The server connection ID is
+ distinct from server (i.e.
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getServer)
+ and is returned in the "connectionId" field of a hello
+ command response MongoDB 4.2+.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the server connection ID, or &null; if it is not available.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserviceid.xml b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserviceid.xml
new file mode 100644
index 0000000000..3ac302ef3e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserviceid.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\CommandSucceededEvent::getServiceId
+ load balancer service ID for the command を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\ObjectIdnullMongoDB\Driver\Monitoring\CommandSucceededEvent::getServiceId
+
+
+
+ When the driver is connected to a MongoDB cluster through a load balancer,
+ the service ID corresponds to the serviceId field in the
+ hello command response.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the load balancer service ID, or &null; if the driver is not
+ connected to a load balancer.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/logsubscriber.xml b/reference/mongodb/mongodb/driver/monitoring/logsubscriber.xml
new file mode 100644
index 0000000000..7590f03c7c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/logsubscriber.xml
@@ -0,0 +1,185 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber インターフェイス
+ MongoDB\Driver\Monitoring\LogSubscriber
+
+
+
+
+
+ &reftitle.intro;
+
+ Classes implementing this interface may be registered as a subscriber and
+ receive log messages from the extension. This is similar to stream-based
+ debug logging (i.e. mongodb.debug)
+ except that trace-level log messages are not received.
+
+
+ As with stream-based logging, it is only possible to register a logger
+ globally using MongoDB\Driver\Monitoring\addSubscriber.
+ The extension is not able to distinguish log messages for individual
+ MongoDB\Driver\Manager objects.
+
+
+
+
+
+ &reftitle.interfacesynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber
+
+
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber
+
+
+
+ MongoDB\Driver\Monitoring\Subscriber
+
+
+
+
+ &Constants;
+
+ const
+ int
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_ERROR
+ 0
+
+
+ const
+ int
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_CRITICAL
+ 1
+
+
+ const
+ int
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_WARNING
+ 2
+
+
+ const
+ int
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_MESSAGE
+ 3
+
+
+ const
+ int
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_INFO
+ 4
+
+
+ const
+ int
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_DEBUG
+ 5
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_ERROR
+
+
+ Error log level. An error condition that the extension is unable to report
+ through its API. This is the most severe log level in the extension.
+
+
+
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_CRITICAL
+
+
+ Critical log level. An error condition with slightly less severity. This
+ constant exists for consistency with libmongoc; however, the extension is
+ unlikely to use it in practice.
+
+
+
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_WARNING
+
+
+ Warning log level. Indicates a situation where undesirable application
+ behavior may occur.
+
+
+
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_MESSAGE
+
+
+ Message or notice log level. Indicates an event that is unusual but not
+ problematic.
+
+
+
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_INFO
+
+
+ Info log level. High-level information about normal driver behavior.
+
+
+
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber::LEVEL_DEBUG
+
+
+ Debug log level. Detailed information that may be helpful when debugging
+ an application.
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.logsubscriber;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/logsubscriber/log.xml b/reference/mongodb/mongodb/driver/monitoring/logsubscriber/log.xml
new file mode 100644
index 0000000000..a23317b4d5
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/logsubscriber/log.xml
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\LogSubscriber::log
+ ログメッセージの通知メソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\LogSubscriber::log
+ intlevel
+ stringdomain
+ stringmessage
+
+
+ If the subscriber is registered, this method is called for each logged
+ message.
+
+
+
+
+ &reftitle.parameters;
+
+
+ level
+
+
+ The severity level. This will be one of the
+ interface constants.
+
+
+
+
+ domain
+
+
+ The name of the driver component that emitted the log message.
+
+
+
+
+ message
+
+
+ The log message.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber.xml
new file mode 100644
index 0000000000..27957d4c34
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber インターフェイス
+ MongoDB\Driver\Monitoring\SDAMSubscriber
+
+
+
+
+
+ &reftitle.intro;
+
+ Classes may implement this interface to register an event subscriber that is
+ notified for various SDAM events. See the
+ Server Discovery and Monitoring
+ and SDAM Monitoring
+ specifications for additional information.
+
+
+
+
+
+ &reftitle.interfacesynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber
+
+
+
+ MongoDB\Driver\Monitoring\Subscriber
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.tentative-return-types-enforced;
+ &mongodb.changelog.tentative-return-types;
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.sdamsubscriber;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverchanged.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverchanged.xml
new file mode 100644
index 0000000000..b30caef428
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverchanged.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber::serverChanged
+ サーバー記述の変更を通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\SDAMSubscriber::serverChanged
+ MongoDB\Driver\Monitoring\ServerChangedEventevent
+
+
+ If the subscriber is registered, this method is called when a server's
+ description changes. For example, a server's type changing from secondary to
+ primary would cause its server description to change.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\ServerChangedEvent)
+
+
+ An event object encapsulating information about the changed server
+ description.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\ServerChangedEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverclosed.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverclosed.xml
new file mode 100644
index 0000000000..b3a2fe7496
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverclosed.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber::serverClosed
+ サーバーのクローズを通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\SDAMSubscriber::serverClosed
+ MongoDB\Driver\Monitoring\ServerClosedEventevent
+
+
+ If the subscriber is registered, this method is called when an existing
+ server is removed from the topology.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\ServerClosedEvent)
+
+
+ An event object encapsulating information about the closed server.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\ServerClosedEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatfailed.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatfailed.xml
new file mode 100644
index 0000000000..0b48d4aed3
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatfailed.xml
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber::serverHeartbeatFailed
+ サーバーハートビートの失敗を通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\SDAMSubscriber::serverHeartbeatFailed
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEventevent
+
+
+ If the subscriber is registered, this method is called when a server
+ heartbeat (i.e.
+ hello
+ command issued through
+ server monitoring) fails.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent)
+
+
+ An event object encapsulating information about the failed server
+ heartbeat.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatstarted.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatstarted.xml
new file mode 100644
index 0000000000..3639d722c5
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatstarted.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber::serverHeartbeatStarted
+ サーバーハートビートの開始を通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\SDAMSubscriber::serverHeartbeatStarted
+ MongoDB\Driver\Monitoring\ServerHeartbeatStartedEventevent
+
+
+ If the subscriber is registered, this method is called when a server
+ heartbeat (i.e.
+ hello
+ command issued through
+ server monitoring) is sent to
+ the server.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent)
+
+
+ An event object encapsulating information about the started server
+ heartbeat.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatsucceeded.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatsucceeded.xml
new file mode 100644
index 0000000000..8c42cca8aa
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatsucceeded.xml
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber::serverHeartbeatSucceeded
+ サーバーハートビートの成功を通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\SDAMSubscriber::serverHeartbeatSucceeded
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEventevent
+
+
+ If the subscriber is registered, this method is called when a server
+ heartbeat (i.e.
+ hello
+ command issued through
+ server monitoring) succeeds.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent)
+
+
+ An event object encapsulating information about the successful server
+ heartbeat.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serveropening.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serveropening.xml
new file mode 100644
index 0000000000..b22732b7ff
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serveropening.xml
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber::serverOpening
+ サーバーのオープンを通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\SDAMSubscriber::serverOpening
+ MongoDB\Driver\Monitoring\ServerOpeningEventevent
+
+
+ If the subscriber is registered, this method is called when a new server is
+ added to the topology.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\ServerOpeningEvent)
+
+
+ An event object encapsulating information about the opened server.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\ServerOpeningEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologychanged.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologychanged.xml
new file mode 100644
index 0000000000..ba7ee0ce5d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologychanged.xml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber::topologyChanged
+ トポロジー記述の変更を通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\SDAMSubscriber::topologyChanged
+ MongoDB\Driver\Monitoring\TopologyChangedEventevent
+
+
+ If the subscriber is registered, this method is called when the topology's
+ description changes. For example, a topology discovering a new replica set
+ primary would cause its topology description to change.
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\TopologyChangedEvent)
+
+
+ An event object encapsulating information about the changed topology
+ description.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\TopologyChangedEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologyclosed.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologyclosed.xml
new file mode 100644
index 0000000000..a830c672c7
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologyclosed.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber::topologyClosed
+ トポロジーのクローズを通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\SDAMSubscriber::topologyClosed
+ MongoDB\Driver\Monitoring\TopologyClosedEventevent
+
+
+ If the subscriber is registered, this method is called when the topology is
+ closed.
+
+
+
+ Due to the driver's
+ connection handling and persistence
+ behavior, this event can only be observed when a
+ MongoDB\Driver\Manager is created with the
+ "disableClientPersistence" driver option and freed before
+ request shutdown (RSHUTDOWN).
+
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\TopologyClosedEvent)
+
+
+ An event object encapsulating information about the closed topology.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\TopologyClosedEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologyopening.xml b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologyopening.xml
new file mode 100644
index 0000000000..4480c689b2
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologyopening.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\SDAMSubscriber::topologyOpening
+ トポロジーのオープンを通知するメソッド
+
+
+
+ &reftitle.description;
+
+ abstractpublicvoidMongoDB\Driver\Monitoring\SDAMSubscriber::topologyOpening
+ MongoDB\Driver\Monitoring\TopologyOpeningEventevent
+
+
+ If the subscriber is registered, this method is called when the topology is
+ opened.
+
+
+
+ Due to the driver's
+ connection handling and persistence
+ behavior, this event may not be observed if a
+ MongoDB\Driver\Manager uses a previously persisted
+ libmongoc client.
+
+
+
+
+
+ &reftitle.parameters;
+
+
+ event (MongoDB\Driver\Monitoring\TopologyOpeningEvent)
+
+
+ An event object encapsulating information about the opened topology.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Monitoring\TopologyOpeningEvent
+ MongoDB\Driver\Monitoring\addSubscriber
+ MongoDB\Driver\Manager::addSubscriber
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverchangedevent.xml b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent.xml
new file mode 100644
index 0000000000..818ce00e7d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerChangedEvent クラス
+ MongoDB\Driver\Monitoring\ServerChangedEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\ServerChangedEvent
+ class encapsulates information about a changed server description. For
+ example, a server's type changing from secondary to primary would cause its
+ server description to change.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\ServerChangedEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\ServerChangedEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.serverchangedevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/gethost.xml b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/gethost.xml
new file mode 100644
index 0000000000..ad748560a7
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/gethost.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerChangedEvent::getHost
+ hostname of the server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\ServerChangedEvent::getHost
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of the server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getnewdescription.xml b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getnewdescription.xml
new file mode 100644
index 0000000000..05c57d3587
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getnewdescription.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerChangedEvent::getNewDescription
+ new description for the server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerDescriptionMongoDB\Driver\Monitoring\ServerChangedEvent::getNewDescription
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the new MongoDB\Driver\ServerDescription
+ for the server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getport.xml b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getport.xml
new file mode 100644
index 0000000000..6a83ea0dcf
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getport.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerChangedEvent::getPort
+ port on which this server is listening を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\ServerChangedEvent::getPort
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getpreviousdescription.xml b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getpreviousdescription.xml
new file mode 100644
index 0000000000..0708234d43
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getpreviousdescription.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerChangedEvent::getPreviousDescription
+ previous description for the server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerDescriptionMongoDB\Driver\Monitoring\ServerChangedEvent::getPreviousDescription
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the previous MongoDB\Driver\ServerDescription
+ for the server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/gettopologyid.xml b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/gettopologyid.xml
new file mode 100644
index 0000000000..e6b11542d8
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverchangedevent/gettopologyid.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerChangedEvent::getTopologyId
+ topology ID associated with this server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\ObjectIdMongoDB\Driver\Monitoring\ServerChangedEvent::getTopologyId
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the topology ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverclosedevent.xml b/reference/mongodb/mongodb/driver/monitoring/serverclosedevent.xml
new file mode 100644
index 0000000000..ba1b9fdd7e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverclosedevent.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerClosedEvent クラス
+ MongoDB\Driver\Monitoring\ServerClosedEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\ServerClosedEvent
+ class encapsulates information about a closed server. This corresponds to an
+ existing server being removed from the topology.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\ServerClosedEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\ServerClosedEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.serverclosedevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverclosedevent/gethost.xml b/reference/mongodb/mongodb/driver/monitoring/serverclosedevent/gethost.xml
new file mode 100644
index 0000000000..fcb8ca04cc
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverclosedevent/gethost.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerClosedEvent::getHost
+ hostname of the server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\ServerClosedEvent::getHost
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of the server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverclosedevent/getport.xml b/reference/mongodb/mongodb/driver/monitoring/serverclosedevent/getport.xml
new file mode 100644
index 0000000000..51fd9ba026
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverclosedevent/getport.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerClosedEvent::getPort
+ port on which this server is listening を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\ServerClosedEvent::getPort
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverclosedevent/gettopologyid.xml b/reference/mongodb/mongodb/driver/monitoring/serverclosedevent/gettopologyid.xml
new file mode 100644
index 0000000000..dc9594f6a1
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverclosedevent/gettopologyid.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerClosedEvent::getTopologyId
+ topology ID associated with this server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\ObjectIdMongoDB\Driver\Monitoring\ServerClosedEvent::getTopologyId
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the topology ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent.xml
new file mode 100644
index 0000000000..8232f48e12
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent クラス
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent
+ class encapsulates information about a failed server heartbeat (i.e.
+ hello
+ command issued through
+ server monitoring).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.serverheartbeatfailedevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/getdurationmicros.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/getdurationmicros.xml
new file mode 100644
index 0000000000..29028f7713
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/getdurationmicros.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getDurationMicros
+ heartbeat's duration in microseconds を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getDurationMicros
+
+
+
+ The heartbeat's duration is a calculated value that includes the time to send
+ the message and receive the reply from the server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the heartbeat's duration in microseconds.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/geterror.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/geterror.xml
new file mode 100644
index 0000000000..fa67938c6a
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/geterror.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getError
+ Exception associated with the failed heartbeat を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicExceptionMongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getError
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the Exception associated with the failed
+ heartbeat.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/gethost.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/gethost.xml
new file mode 100644
index 0000000000..eaabbde043
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/gethost.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getHost
+ hostname of the server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getHost
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of the server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/getport.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/getport.xml
new file mode 100644
index 0000000000..47555c2b16
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/getport.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getPort
+ port on which this server is listening を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::getPort
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/isawaited.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/isawaited.xml
new file mode 100644
index 0000000000..7f27b0a3a6
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/isawaited.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::isAwaited
+ the heartbeat used a streaming protocol かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent::isAwaited
+
+
+
+ Returns whether the heartbeat used a streaming protocol. The extension does
+ not use the streaming protocol for monitoring, so this method will always
+ return &false;.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &false;.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent.xml
new file mode 100644
index 0000000000..d4bfe71991
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent クラス
+ MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent
+ class encapsulates information about a started server heartbeat (i.e.
+ hello
+ command issued through
+ server monitoring).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.serverheartbeatstartedevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/gethost.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/gethost.xml
new file mode 100644
index 0000000000..96e74efadd
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/gethost.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent::getHost
+ hostname of the server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent::getHost
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of the server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/getport.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/getport.xml
new file mode 100644
index 0000000000..585d5e9656
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/getport.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent::getPort
+ port on which this server is listening を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent::getPort
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/isawaited.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/isawaited.xml
new file mode 100644
index 0000000000..b0c9ba0bb5
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/isawaited.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent::isAwaited
+ the heartbeat used a streaming protocol かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent::isAwaited
+
+
+
+ Returns whether the heartbeat used a streaming protocol. The extension does
+ not use the streaming protocol for monitoring, so this method will always
+ return &false;.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &false;.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent.xml
new file mode 100644
index 0000000000..03a19f4c25
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent クラス
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent
+ class encapsulates information about a successful server heartbeat (i.e.
+ hello
+ command issued through
+ server monitoring).
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.serverheartbeatsucceededevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getdurationmicros.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getdurationmicros.xml
new file mode 100644
index 0000000000..b85d141451
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getdurationmicros.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getDurationMicros
+ heartbeat's duration in microseconds を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getDurationMicros
+
+
+
+ The heartbeat's duration is a calculated value that includes the time to send
+ the message and receive the reply from the server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the heartbeat's duration in microseconds.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/gethost.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/gethost.xml
new file mode 100644
index 0000000000..b8ecde0a14
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/gethost.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getHost
+ hostname of the server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getHost
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of the server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getport.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getport.xml
new file mode 100644
index 0000000000..e25fd87ef1
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getport.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getPort
+ port on which this server is listening を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getPort
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getreply.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getreply.xml
new file mode 100644
index 0000000000..4ce2cc0d74
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getreply.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getReply
+ heartbeat reply document を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectMongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::getReply
+
+
+
+ The reply document will be converted from BSON to PHP using the default
+ deserialization
+ rules (e.g. BSON documents will be converted to stdClass).
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the heartbeat reply document as a stdClass
+ object.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/isawaited.xml b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/isawaited.xml
new file mode 100644
index 0000000000..dcf74ade41
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/isawaited.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::isAwaited
+ the heartbeat used a streaming protocol かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent::isAwaited
+
+
+
+ Returns whether the heartbeat used a streaming protocol. The extension does
+ not use the streaming protocol for monitoring, so this method will always
+ return &false;.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &false;.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serveropeningevent.xml b/reference/mongodb/mongodb/driver/monitoring/serveropeningevent.xml
new file mode 100644
index 0000000000..92ae5b7d39
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serveropeningevent.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerOpeningEvent クラス
+ MongoDB\Driver\Monitoring\ServerOpeningEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\ServerOpeningEvent
+ class encapsulates information about an opened server. This corresponds to a
+ new server being added to the topology.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\ServerOpeningEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\ServerOpeningEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.serveropeningevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serveropeningevent/gethost.xml b/reference/mongodb/mongodb/driver/monitoring/serveropeningevent/gethost.xml
new file mode 100644
index 0000000000..e90fbeb360
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serveropeningevent/gethost.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerOpeningEvent::getHost
+ hostname of the server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Monitoring\ServerOpeningEvent::getHost
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of the server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serveropeningevent/getport.xml b/reference/mongodb/mongodb/driver/monitoring/serveropeningevent/getport.xml
new file mode 100644
index 0000000000..4325a01d0b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serveropeningevent/getport.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerOpeningEvent::getPort
+ port on which this server is listening を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Monitoring\ServerOpeningEvent::getPort
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/serveropeningevent/gettopologyid.xml b/reference/mongodb/mongodb/driver/monitoring/serveropeningevent/gettopologyid.xml
new file mode 100644
index 0000000000..30ab0982b3
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/serveropeningevent/gettopologyid.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\ServerOpeningEvent::getTopologyId
+ topology ID associated with this server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\ObjectIdMongoDB\Driver\Monitoring\ServerOpeningEvent::getTopologyId
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the topology ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/subscriber.xml b/reference/mongodb/mongodb/driver/monitoring/subscriber.xml
new file mode 100644
index 0000000000..e93e072187
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/subscriber.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\Subscriber インターフェイス
+ MongoDB\Driver\Monitoring\Subscriber
+
+
+
+
+
+ &reftitle.intro;
+
+ Base interface for event subscribers. This is used as a parameter type in the functions
+ MongoDB\Driver\Monitoring\addSubscriber and
+ MongoDB\Driver\Monitoring\removeSubscriber and should
+ not be implemented directly.
+
+
+
+
+
+ &reftitle.interfacesynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\Subscriber
+
+
+
+
+ MongoDB\Driver\Monitoring\Subscriber
+
+
+
+
+
+
+
+
+ This interface has no methods. Its only purpose is to be the base interface
+ for all event subscribers.
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/topologychangedevent.xml b/reference/mongodb/mongodb/driver/monitoring/topologychangedevent.xml
new file mode 100644
index 0000000000..0f2a43fb15
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/topologychangedevent.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\TopologyChangedEvent クラス
+ MongoDB\Driver\Monitoring\TopologyChangedEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\TopologyChangedEvent
+ class encapsulates information about a changed topology description. For
+ example, a topology discovering a new replica set primary would cause its
+ topology description to change.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\TopologyChangedEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\TopologyChangedEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.topologychangedevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/topologychangedevent/getnewdescription.xml b/reference/mongodb/mongodb/driver/monitoring/topologychangedevent/getnewdescription.xml
new file mode 100644
index 0000000000..cf342b320d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/topologychangedevent/getnewdescription.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\TopologyChangedEvent::getNewDescription
+ new description for the topology を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\TopologyDescriptionMongoDB\Driver\Monitoring\TopologyChangedEvent::getNewDescription
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the new MongoDB\Driver\TopologyDescription
+ for the topology.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/topologychangedevent/getpreviousdescription.xml b/reference/mongodb/mongodb/driver/monitoring/topologychangedevent/getpreviousdescription.xml
new file mode 100644
index 0000000000..0b4a9225be
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/topologychangedevent/getpreviousdescription.xml
@@ -0,0 +1,60 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\TopologyChangedEvent::getPreviousDescription
+ previous description for the topology を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\TopologyDescriptionMongoDB\Driver\Monitoring\TopologyChangedEvent::getPreviousDescription
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the previous MongoDB\Driver\TopologyDescription
+ for the topology.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/topologychangedevent/gettopologyid.xml b/reference/mongodb/mongodb/driver/monitoring/topologychangedevent/gettopologyid.xml
new file mode 100644
index 0000000000..5d975d88d3
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/topologychangedevent/gettopologyid.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\TopologyChangedEvent::getTopologyId
+ topology ID を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\ObjectIdMongoDB\Driver\Monitoring\TopologyChangedEvent::getTopologyId
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the topology ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/topologyclosedevent.xml b/reference/mongodb/mongodb/driver/monitoring/topologyclosedevent.xml
new file mode 100644
index 0000000000..b98208d692
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/topologyclosedevent.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\TopologyClosedEvent クラス
+ MongoDB\Driver\Monitoring\TopologyClosedEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\TopologyClosedEvent
+ class encapsulates information about a closed topology.
+
+
+
+ Due to the driver's
+ connection handling and persistence
+ behavior, this event can only be observed when a
+ MongoDB\Driver\Manager is created with the
+ "disableClientPersistence" driver option and freed
+ before request shutdown (RSHUTDOWN).
+
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\TopologyClosedEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\TopologyClosedEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.topologyclosedevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/topologyclosedevent/gettopologyid.xml b/reference/mongodb/mongodb/driver/monitoring/topologyclosedevent/gettopologyid.xml
new file mode 100644
index 0000000000..41e4c6f68d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/topologyclosedevent/gettopologyid.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\TopologyClosedEvent::getTopologyId
+ topology ID を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\ObjectIdMongoDB\Driver\Monitoring\TopologyClosedEvent::getTopologyId
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the topology ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/topologyopeningevent.xml b/reference/mongodb/mongodb/driver/monitoring/topologyopeningevent.xml
new file mode 100644
index 0000000000..e4c093c6be
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/topologyopeningevent.xml
@@ -0,0 +1,79 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\TopologyOpeningEvent クラス
+ MongoDB\Driver\Monitoring\TopologyOpeningEvent
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Monitoring\TopologyOpeningEvent
+ class encapsulates information about an opened topology.
+
+
+
+ Due to the driver's
+ connection handling and persistence
+ behavior, this event may not be observed if a
+ MongoDB\Driver\Manager uses a previously persisted
+ libmongoc client.
+
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Monitoring\TopologyOpeningEvent
+
+
+
+ final
+
+ MongoDB\Driver\Monitoring\TopologyOpeningEvent
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.monitoring.entities.topologyopeningevent;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/monitoring/topologyopeningevent/gettopologyid.xml b/reference/mongodb/mongodb/driver/monitoring/topologyopeningevent/gettopologyid.xml
new file mode 100644
index 0000000000..1773445a2e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/monitoring/topologyopeningevent/gettopologyid.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+ MongoDB\Driver\Monitoring\TopologyOpeningEvent::getTopologyId
+ topology ID を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\ObjectIdMongoDB\Driver\Monitoring\TopologyOpeningEvent::getTopologyId
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the topology ID.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/query.xml b/reference/mongodb/mongodb/driver/query.xml
new file mode 100644
index 0000000000..943e2ce6ee
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/query.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Query クラス
+ MongoDB\Driver\Query
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Query class is a value object that
+ represents a database query.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Query
+
+
+
+ final
+
+ MongoDB\Driver\Query
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.query;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/query/construct.xml b/reference/mongodb/mongodb/driver/query/construct.xml
new file mode 100644
index 0000000000..48b613089e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/query/construct.xml
@@ -0,0 +1,547 @@
+
+
+
+
+
+
+ MongoDB\Driver\Query::__construct
+ 新しい Query を作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\Query::__construct
+ arrayobjectfilter
+ arraynullqueryOptions&null;
+
+
+ Constructs a new MongoDB\Driver\Query, which is an
+ immutable value object that represents a database query. The query may then
+ be executed with
+ MongoDB\Driver\Manager::executeQuery.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.filter;
+
+ queryOptions
+
+
+
+ queryOptions
+
+
+
+ Option
+ Type
+ Description
+
+
+
+
+ allowDiskUse
+ bool
+
+
+ Allows MongoDB to use temporary disk files to store data exceeding
+ the 100 megabyte system memory limit while processing a blocking
+ sort operation.
+
+
+
+
+ allowPartialResults
+ bool
+
+
+ For queries against a sharded collection, returns partial results
+ from the mongos if some shards are unavailable instead of throwing
+ an error.
+
+
+ Falls back to the deprecated "partial" option if
+ not specified.
+
+
+
+
+ awaitData
+ bool
+
+ Use in conjunction with the "tailable" option to
+ block a getMore operation on the cursor temporarily if at the end of
+ data rather than returning no data. After a timeout period, the query
+ returns as normal.
+
+
+
+ batchSize
+ int
+
+
+ The number of documents to return in the first batch. Defaults to
+ 101. A batch size of 0 means that the cursor will be established,
+ but no documents will be returned in the first batch.
+
+
+ In versions of MongoDB before 3.2, where queries use the legacy wire
+ protocol OP_QUERY, a batch size of 1 will close the cursor
+ irrespective of the number of matched documents.
+
+
+
+ &mongodb.option.collation;
+
+ comment
+ mixed
+
+
+ An arbitrary comment to help trace the operation through the
+ database profiler, currentOp output, and logs.
+
+
+ The comment can be any valid BSON type for MongoDB 4.4+. Earlier
+ server versions only support string values.
+
+
+ Falls back to the deprecated "$comment" modifier
+ if not specified.
+
+
+
+
+ exhaust
+ bool
+
+
+ Stream the data down full blast in multiple "more" packages, on the
+ assumption that the client will fully read all data queried. Faster
+ when you are pulling a lot of data and know you want to pull it all
+ down. Note: the client is not allowed to not read all the data
+ unless it closes the connection.
+
+
+ This option is not supported by the find command in MongoDB 3.2+ and
+ will force the driver to use the legacy wire protocol version (i.e.
+ OP_QUERY).
+
+
+
+
+ explain
+ bool
+
+
+ If &true;, the returned MongoDB\Driver\Cursor
+ will contain a single document that describes the process and
+ indexes used to return the query.
+
+
+ Falls back to the deprecated "$explain" modifier
+ if not specified.
+
+
+ This option is not supported by the find command in MongoDB 3.2+ and
+ will only be respected when using the legacy wire protocol version
+ (i.e. OP_QUERY). The
+ explain
+ command should be used on MongoDB 3.0+.
+
+
+
+
+ hint
+ stringarrayobject
+
+
+ Index specification. Specify either the index name as a string or
+ the index key pattern. If specified, then the query system will only
+ consider plans using the hinted index.
+
+
+ Falls back to the deprecated "hint" option if not
+ specified.
+
+
+
+ &mongodb.option.let;
+
+ limit
+ int
+
+
+ The maximum number of documents to return. If unspecified, then
+ defaults to no limit. A limit of 0 is equivalent to setting no
+ limit.
+
+
+
+
+ max
+ arrayobject
+
+
+ The exclusive upper bound for a specific index.
+
+
+ Falls back to the deprecated "$max" modifier if
+ not specified.
+
+
+
+
+ maxAwaitTimeMS
+ int
+
+
+ Positive integer denoting the time limit in milliseconds for the
+ server to block a getMore operation if no data is available. This
+ option should only be used in conjunction with the
+ "tailable" and "awaitData"
+ options.
+
+
+
+
+ maxTimeMS
+ int
+
+
+ The cumulative time limit in milliseconds for processing operations
+ on the cursor. MongoDB aborts the operation at the earliest
+ following interrupt point.
+
+
+ Falls back to the deprecated "$maxTimeMS"
+ modifier if not specified.
+
+
+
+
+ min
+ arrayobject
+
+
+ The inclusive lower bound for a specific index.
+
+
+ Falls back to the deprecated "$min" modifier if
+ not specified.
+
+
+
+
+ noCursorTimeout
+ bool
+
+ Prevents the server from timing out idle cursors after an inactivity
+ period (10 minutes).
+
+
+
+ projection
+ arrayobject
+
+
+ The projection specification
+ to determine which fields to include in the returned documents.
+
+
+ If you are using the ODM
+ functionality to deserialise documents as their original
+ PHP class, make sure that you include the
+ __pclass field in the projection. This is
+ required for the deserialization to work and without it, the
+ extension will return (by default) a stdClass
+ object instead.
+
+
+
+
+ readConcern
+ MongoDB\Driver\ReadConcern
+
+
+ A read concern to apply to the operation. By default, the read
+ concern from the
+ MongoDB
+ Connection URI will be used.
+
+
+ This option is available in MongoDB 3.2+ and will result in an
+ exception at execution time if specified for an older server
+ version.
+
+
+
+
+ returnKey
+ bool
+
+
+ If &true;, returns only the index keys in the resulting documents.
+ Default value is &false;. If &true; and the find command does not
+ use an index, the returned documents will be empty.
+
+
+ Falls back to the deprecated "$returnKey"
+ modifier if not specified.
+
+
+
+
+ showRecordId
+ bool
+
+
+ Determines whether to return the record identifier for each
+ document. If &true;, adds a top-level "$recordId"
+ field to the returned documents.
+
+
+ Falls back to the deprecated "$showDiskLoc"
+ modifier if not specified.
+
+
+
+
+ singleBatch
+ bool
+
+ Determines whether to close the cursor after the first batch.
+ Defaults to &false;.
+
+
+
+ skip
+ int
+ Number of documents to skip. Defaults to 0.
+
+
+ sort
+ arrayobject
+
+ The sort specification for the ordering of the results.
+
+ Falls back to the deprecated "$orderby" modifier
+ if not specified.
+
+
+
+
+ tailable
+ bool
+ Returns a tailable cursor for a capped collection.
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+
+ The "partial" option was removed. Use the
+ "allowPartialResults" option instead.
+
+
+ The "maxScan" option was removed. Support for this
+ option was removed in MongoDB 4.2.
+
+
+ The "modifiers" option was removed. This option was
+ used for legacy query modifiers, which are all deprecated.
+
+
+ The "oplogReplay" option was removed. It is ignored
+ in MongoDB 4.4 and newer.
+
+
+ The "snapshot" option was removed. Support for this
+ option was removed in MongoDB 4.0.
+
+
+ A negative value for the "limit" option no longer
+ implies &true; for the "singleBatch" option. To only
+ receive a single batch of results, combine a positive
+ "limit" value with the
+ "singleBatch" option.
+
+
+
+
+ PECL mongodb 1.14.0
+
+
+ Added the "let" option. The
+ "comment" option now accepts any type.
+
+
+
+
+ PECL mongodb 1.8.0
+
+
+ Added the "allowDiskUse" option.
+
+
+ The "oplogReplay" option is deprecated.
+
+
+
+
+ PECL mongodb 1.5.0
+
+
+ The "maxScan" and "snapshot"
+ options are deprecated.
+
+
+
+
+ PECL mongodb 1.3.0
+
+
+ Added the "maxAwaitTimeMS" option.
+
+
+
+
+ PECL mongodb 1.2.0
+
+
+ Added the "allowPartialResults",
+ "collation", "comment",
+ "hint", "max",
+ "maxScan", "maxTimeMS",
+ "min", "returnKey",
+ "showRecordId", and "snapshot"
+ options.
+
+
+ Renamed the "partial" option to
+ "allowPartialResults". For backwards compatibility,
+ "partial" will still be read if
+ "allowPartialResults" is not specified.
+
+
+ Removed the legacy "secondaryOk" option, which is
+ obsolete. For queries using the legacy wire protocol OP_QUERY, the
+ driver will set the secondaryOk bit as needed in
+ accordance with the
+ Server Selection Specification.
+
+
+
+
+ PECL mongodb 1.1.0
+ Added the "readConcern" option.
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Query::__construct の例
+
+ 'bjori',
+ 'views' => [
+ '$gte' => 100,
+ ],
+];
+
+$options = [
+ /* Only return the following fields in the matching documents */
+ 'projection' => [
+ 'title' => 1,
+ 'article' => 1,
+ ],
+ /* Return the documents in descending order of views */
+ 'sort' => [
+ 'views' => -1
+ ],
+];
+
+$query = new MongoDB\Driver\Query($filter, $options);
+
+$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017');
+$readPreference = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::PRIMARY);
+$cursor = $manager->executeQuery('databaseName.collectionName', $query, ['readPreference' => $readPreference]);
+
+foreach($cursor as $document) {
+ var_dump($document);
+}
+
+?>
+]]>
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::executeQuery
+ MongoDB\Driver\Cursor
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readconcern.xml b/reference/mongodb/mongodb/driver/readconcern.xml
new file mode 100644
index 0000000000..4b88b074c5
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readconcern.xml
@@ -0,0 +1,316 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadConcern クラス
+ MongoDB\Driver\ReadConcern
+
+
+
+
+
+ &reftitle.intro;
+
+ MongoDB\Driver\ReadConcern controls the level of
+ isolation for read operations for replica sets and replica set shards. This
+ option requires MongoDB 3.2 or later.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\ReadConcern
+
+
+
+ final
+
+ MongoDB\Driver\ReadConcern
+
+
+
+ MongoDB\BSON\Serializable
+
+
+
+ Serializable
+
+
+
+ &Constants;
+
+ const
+ string
+ MongoDB\Driver\ReadConcern::AVAILABLE
+ "available"
+
+
+ const
+ string
+ MongoDB\Driver\ReadConcern::LINEARIZABLE
+ "linearizable"
+
+
+ const
+ string
+ MongoDB\Driver\ReadConcern::LOCAL
+ "local"
+
+
+ const
+ string
+ MongoDB\Driver\ReadConcern::MAJORITY
+ "majority"
+
+
+ const
+ string
+ MongoDB\Driver\ReadConcern::SNAPSHOT
+ "snapshot"
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+
+ MongoDB\Driver\ReadConcern::AVAILABLE
+
+
+ Default for reads against secondaries when
+ afterClusterTimeand level are
+ unspecified.
+
+
+ The query returns the instance's most recent data. Provides no
+ guarantee that the data has been written to a majority of the replica set
+ members (i.e. may be rolled back).
+
+
+ For unsharded collections (including collections in a standalone
+ deployment or a replica set deployment), "local" and
+ "available" read concerns behave identically.
+
+
+ For a sharded cluster, "available" read concern
+ provides greater tolerance for partitions since it does not wait to
+ ensure consistency guarantees. However, a query with
+ "available" read concern may return orphan documents
+ if the shard is undergoing chunk migrations since the
+ "available" read concern, unlike
+ "local" read concern, does not contact the
+ shard's primary nor the config servers for updated metadata.
+
+
+
+
+
+ MongoDB\Driver\ReadConcern::LINEARIZABLE
+
+
+ The query returns data that reflects all successful writes issued with a
+ write concern of "majority"and
+ acknowledged prior to the start of the read operation. For replica sets
+ that run with writeConcernMajorityJournalDefault set
+ to &true;, linearizable read concern returns data that will never be
+ rolled back.
+
+
+ With writeConcernMajorityJournalDefault set to
+ &false;, MongoDB will not wait for w: "majority"
+ writes to be durable before acknowledging the writes. As such,
+ "majority" write operations could possibly roll back
+ in the event of a loss of a replica set member.
+
+
+ You can specify linearizable read concern for read operations on the
+ primary only.
+
+
+ Linearizable read concern guarantees only apply if read
+ operations specify a query filter that uniquely identifies a single
+ document.
+
+
+
+ Always use maxTimeMS with linearizable read concern
+ in case a majority of data bearing members are unavailable.
+ maxTimeMS ensures that the operation does not block
+ indefinitely and instead ensures that the operation returns an error if
+ the read concern cannot be fulfilled.
+
+
+
+ Linearizable read concern requires MongoDB 3.4.
+
+
+
+
+
+ MongoDB\Driver\ReadConcern::LOCAL
+
+
+ Default for reads against primary if level is
+ unspecified and for reads against secondaries if level
+ is unspecified but afterClusterTime is specified.
+
+
+ The query returns the instance's most recent data. Provides no
+ guarantee that the data has been written to a majority of the replica set
+ members (i.e. may be rolled back).
+
+
+
+
+
+ MongoDB\Driver\ReadConcern::MAJORITY
+
+
+ The query returns the instance's most recent data acknowledged as
+ having been written to a majority of members in the replica set.
+
+
+ To use read concern level of "majority", replica sets
+ must use WiredTiger storage engine and election protocol version 1.
+
+
+
+
+
+ MongoDB\Driver\ReadConcern::SNAPSHOT
+
+
+ Read concern "snapshot" is available for
+ multi-document transactions, and starting in MongoDB 5.0, certain read
+ operations outside of multi-document transactions.
+
+
+ If the transaction is not part of a causally consistent session, upon
+ transaction commit with write concern "majority", the
+ transaction operations are guaranteed to have read from a snapshot of
+ majority-committed data.
+
+
+ If the transaction is part of a causally consistent session, upon
+ transaction commit with write concern "majority", the
+ transaction operations are guaranteed to have read from a snapshot of
+ majority-committed data that provides causal consistency with the
+ operation immediately preceding the transaction start.
+
+
+ Outside of multi-document transactions, read concern
+ "snapshot" is available on primaries and secondaries
+ for the following read operations: find,
+ aggregate, and distinct (on
+ unsharded collections). All other read commands prohibit
+ "snapshot".
+
+
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.11.0
+
+
+ Added the MongoDB\Driver\ReadConcern::SNAPSHOT
+ constant.
+
+
+
+
+ PECL mongodb 1.7.0
+
+ Serializable を実装しました。
+
+
+
+ PECL mongodb 1.4.0
+
+
+ Added the MongoDB\Driver\ReadConcern::AVAILABLE
+ constant.
+
+
+
+
+ PECL mongodb 1.2.0
+
+
+ Added the
+ MongoDB\Driver\ReadConcern::LINEARIZABLE
+ constant.
+
+
+ MongoDB\BSON\Serializable を実装しました。
+
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Read Concern reference
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.readconcern;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readconcern/bsonserialize.xml b/reference/mongodb/mongodb/driver/readconcern/bsonserialize.xml
new file mode 100644
index 0000000000..70ab4e13e9
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readconcern/bsonserialize.xml
@@ -0,0 +1,122 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadConcern::bsonSerialize
+ object for BSON serialization を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstdClassMongoDB\Driver\ReadConcern::bsonSerialize
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an object for serializing the ReadConcern as BSON.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadConcern::bsonSerialize with empty read concern
+
+bsonSerialize());
+
+echo "\n", MongoDB\BSON\Document::fromPHP($rc)->toRelaxedExtendedJSON();
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+
+
+ MongoDB\Driver\ReadConcern::bsonSerialize with local read concern
+
+bsonSerialize());
+
+echo "\n", MongoDB\BSON\Document::fromPHP($rc)->toRelaxedExtendedJSON();
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(5) "local"
+}
+
+{ "level" : "local" }
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\BSON\Serializable::bsonSerialize
+ Read Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readconcern/construct.xml b/reference/mongodb/mongodb/driver/readconcern/construct.xml
new file mode 100644
index 0000000000..581ce0b9f3
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readconcern/construct.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadConcern::__construct
+ 新しい ReadConcern を作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ReadConcern::__construct
+ stringnulllevel&null;
+
+
+ Constructs a new MongoDB\Driver\ReadConcern, which is
+ an immutable value object.
+
+
+
+
+ &reftitle.parameters;
+
+
+ level
+
+
+ The read concern level.
+ You may use, but are not limited to, one of the
+ class constants.
+
+
+
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadConcern::__construct の例
+
+
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Read Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readconcern/getlevel.xml b/reference/mongodb/mongodb/driver/readconcern/getlevel.xml
new file mode 100644
index 0000000000..d078bc7154
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readconcern/getlevel.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadConcern::getLevel
+ ReadConcern の "level" option を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringnullMongoDB\Driver\ReadConcern::getLevel
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the ReadConcern's "level" option.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadConcern::getLevel の例
+
+getLevel());
+
+$rc = new MongoDB\Driver\ReadConcern(MongoDB\Driver\ReadConcern::LOCAL);
+var_dump($rc->getLevel());
+
+$rc = new MongoDB\Driver\ReadConcern(MongoDB\Driver\ReadConcern::MAJORITY);
+var_dump($rc->getLevel());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Read Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readconcern/isdefault.xml b/reference/mongodb/mongodb/driver/readconcern/isdefault.xml
new file mode 100644
index 0000000000..64a2eb6633
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readconcern/isdefault.xml
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadConcern::isDefault
+ this is the default read concern かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\ReadConcern::isDefault
+
+
+
+ Returns whether this is the default read concern (i.e. no options are
+ specified). This method is primarily intended to be used in conjunction with
+ MongoDB\Driver\Manager::getReadConcern to determine
+ whether the Manager has been constructed without any read concern options.
+
+
+ The driver will not include a default read concern in its read operations
+ (e.g. MongoDB\Driver\Manager::executeQuery) in order
+ order to allow the server to apply its own default. Libraries that access the
+ Manager's read concern to include it in their own read commands should use
+ this method to ensure that default read concerns are left unset.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if this is the default read concern and &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadConcern::isDefault の例
+
+isDefault());
+
+$rc = new MongoDB\Driver\ReadConcern(MongoDB\Driver\ReadConcern::MAJORITY);
+var_dump($rc->isDefault());
+
+$manager = new MongoDB\Driver\Manager('mongodb://127.0.0.1/?readConcernLevel=majority');
+$rc = $manager->getReadConcern();
+var_dump($rc->isDefault());
+
+$manager = new MongoDB\Driver\Manager('mongodb://127.0.0.1/');
+$rc = $manager->getReadConcern();
+var_dump($rc->isDefault());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::getReadConcern
+ Read Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readpreference.xml b/reference/mongodb/mongodb/driver/readpreference.xml
new file mode 100644
index 0000000000..b0c48b96bf
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readpreference.xml
@@ -0,0 +1,282 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadPreference クラス
+ MongoDB\Driver\ReadPreference
+
+
+
+
+
+ &reftitle.intro;
+
+
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\ReadPreference
+
+
+
+ final
+
+ MongoDB\Driver\ReadPreference
+
+
+
+ MongoDB\BSON\Serializable
+
+
+
+ Serializable
+
+
+
+ &Constants;
+
+ const
+ string
+ MongoDB\Driver\ReadPreference::PRIMARY
+ primary
+
+
+ const
+ string
+ MongoDB\Driver\ReadPreference::PRIMARY_PREFERRED
+ primaryPreferred
+
+
+ const
+ string
+ MongoDB\Driver\ReadPreference::SECONDARY
+ secondary
+
+
+ const
+ string
+ MongoDB\Driver\ReadPreference::SECONDARY_PREFERRED
+ secondaryPreferred
+
+
+ const
+ string
+ MongoDB\Driver\ReadPreference::NEAREST
+ nearest
+
+
+ const
+ int
+ MongoDB\Driver\ReadPreference::NO_MAX_STALENESS
+ -1
+
+
+ const
+ int
+ MongoDB\Driver\ReadPreference::SMALLEST_MAX_STALENESS_SECONDS
+ 90
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+
+ MongoDB\Driver\ReadPreference::PRIMARY
+
+
+ All operations read from the current replica set primary. This is the
+ default read preference for MongoDB.
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::PRIMARY_PREFERRED
+
+
+ In most situations, operations read from the primary but if it is
+ unavailable, operations read from secondary members.
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::SECONDARY
+
+
+ All operations read from the secondary members of the replica set.
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::SECONDARY_PREFERRED
+
+
+ In most situations, operations read from secondary members but if no
+ secondary members are available, operations read from the primary.
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::NEAREST
+
+
+ Operations read from member of the replica set with the least network
+ latency, irrespective of the member's type.
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::NO_MAX_STALENESS
+
+
+ The default value for the "maxStalenessSeconds"
+ option is to specify no limit on maximum staleness, which means that the
+ driver will not consider a secondary's lag when choosing where to
+ direct a read operation.
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::SMALLEST_MAX_STALENESS_SECONDS
+
+
+ The minimum value for the "maxStalenessSeconds" option
+ is 90 seconds. The driver estimates secondaries' staleness by
+ periodically checking the latest write date of each replica set member.
+ Since these checks are infrequent, the staleness estimate is coarse.
+ Thus, the driver cannot enforce a max staleness value of less than 90
+ seconds.
+
+
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+
+ Removed the
+ MongoDB\Driver\ReadPreference::RP_PRIMARY,
+ MongoDB\Driver\ReadPreference::RP_PRIMARY_PREFERRED,
+ MongoDB\Driver\ReadPreference::RP_SECONDARY,
+ MongoDB\Driver\ReadPreference::RP_SECONDARY_PREFERRED,
+ and MongoDB\Driver\ReadPreference::RP_NEAREST
+ constants. The getMode method was also removed.
+
+
+
+
+ PECL mongodb 1.20.0
+
+
+ Deprecated the
+ MongoDB\Driver\ReadPreference::RP_PRIMARY,
+ MongoDB\Driver\ReadPreference::RP_PRIMARY_PREFERRED,
+ MongoDB\Driver\ReadPreference::RP_SECONDARY,
+ MongoDB\Driver\ReadPreference::RP_SECONDARY_PREFERRED,
+ and MongoDB\Driver\ReadPreference::RP_NEAREST
+ constants.
+
+
+
+
+ PECL mongodb 1.7.0
+
+
+ Added the
+ MongoDB\Driver\ReadPreference::PRIMARY,
+ MongoDB\Driver\ReadPreference::PRIMARY_PREFERRED,
+ MongoDB\Driver\ReadPreference::SECONDARY,
+ MongoDB\Driver\ReadPreference::SECONDARY_PREFERRED,
+ and MongoDB\Driver\ReadPreference::NEAREST
+ constants.
+
+
+ Serializable を実装しました。
+
+
+
+
+ PECL mongodb 1.2.0
+
+
+ Added the
+ MongoDB\Driver\ReadPreference::NO_MAX_STALENESS
+ and
+ MongoDB\Driver\ReadPreference::SMALLEST_MAX_STALENESS_SECONDS
+ constants.
+
+
+ MongoDB\BSON\Serializable を実装しました。
+
+
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.readpreference;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readpreference/bsonserialize.xml b/reference/mongodb/mongodb/driver/readpreference/bsonserialize.xml
new file mode 100644
index 0000000000..67222e4337
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readpreference/bsonserialize.xml
@@ -0,0 +1,182 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::bsonSerialize
+ object for BSON serialization を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstdClassMongoDB\Driver\ReadPreference::bsonSerialize
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an object for serializing the ReadPreference as BSON.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadPreference::bsonSerialize with primary read preference
+
+bsonSerialize());
+
+echo "\n", MongoDB\BSON\Document::fromPHP($rp)->toRelaxedExtendedJSON();
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(7) "primary"
+}
+
+{ "mode" : "primary" }
+]]>
+
+
+
+ MongoDB\Driver\ReadPreference::bsonSerialize with secondary read preference and tag sets
+
+ 'ny'],
+ ['dc' => 'sf', 'use' => 'reporting'],
+ []
+ ]
+);
+var_dump($rp->bsonSerialize());
+
+echo "\n", MongoDB\BSON\Document::fromPHP($rp)->toRelaxedExtendedJSON();
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(9) "secondary"
+ ["tags"]=>
+ array(3) {
+ [0]=>
+ object(stdClass)#1 (1) {
+ ["dc"]=>
+ string(2) "ny"
+ }
+ [1]=>
+ object(stdClass)#5 (2) {
+ ["dc"]=>
+ string(2) "sf"
+ ["use"]=>
+ string(9) "reporting"
+ }
+ [2]=>
+ object(stdClass)#4 (0) {
+ }
+ }
+}
+
+{ "mode" : "secondary", "tags" : [ { "dc" : "ny" }, { "dc" : "sf", "use" : "reporting" }, { } ] }
+]]>
+
+
+
+ MongoDB\Driver\ReadPreference::bsonSerialize with secondary read preference and max staleness
+
+ 120]
+);
+var_dump($rp->bsonSerialize());
+
+echo "\n", MongoDB\BSON\Document::fromPHP($rp)->toRelaxedExtendedJSON();
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(9) "secondary"
+ ["maxStalenessSeconds"]=>
+ int(120)
+}
+
+{ "mode" : "secondary", "maxStalenessSeconds" : 120 }
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\BSON\Serializable::bsonSerialize
+ Read Preference reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readpreference/construct.xml b/reference/mongodb/mongodb/driver/readpreference/construct.xml
new file mode 100644
index 0000000000..6e3d53cb7f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readpreference/construct.xml
@@ -0,0 +1,341 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::__construct
+ 新しい ReadPreference を作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ReadPreference::__construct
+ stringmode
+ arraynulltagSets&null;
+ arraynulloptions&null;
+
+
+ Constructs a new MongoDB\Driver\ReadPreference, which
+ is an immutable value object.
+
+
+
+
+ &reftitle.parameters;
+
+
+ mode
+
+
+
+ Read preference mode
+
+
+
+ Value
+ Description
+
+
+
+
+ "primary"
+
+
+ All operations read from the current replica set primary. This is
+ the default read preference for MongoDB.
+
+
+
+
+ "primaryPreferred"
+
+
+ In most situations, operations read from the primary but if it is
+ unavailable, operations read from secondary members.
+
+
+
+
+ "secondary"
+
+
+ All operations read from the secondary members of the replica set.
+
+
+
+
+ "secondaryPreferred"
+
+
+ In most situations, operations read from secondary members but if no
+ secondary members are available, operations read from the primary.
+
+
+
+
+ "nearest"
+
+
+ Operations read from member of the replica set with the least
+ network latency, irrespective of the member's type.
+
+
+
+
+
+
+
+
+
+
+ tagSets
+
+
+ Tag sets allow you to target read operations to specific members of a
+ replica set. This parameter should be an array of associative arrays, each
+ of which contain zero or more key/value pairs. When selecting a server for
+ a read operation, the driver attempt to select a node having all tags in a
+ set (i.e. the associative array of key/value pairs). If selection fails,
+ the driver will attempt subsequent sets. An empty tag set
+ (array()) will match any node and may be used as a
+ fallback.
+
+
+ Tags are not compatible with the "primary" mode and,
+ in general, only apply when selecting a secondary member of a set for a
+ read operation. However, the "nearest" mode, when
+ combined with a tag set, selects the matching member with the lowest
+ network latency. This member may be a primary or secondary.
+
+
+
+
+ options
+
+
+
+ options
+
+
+
+ Option
+ Type
+ Description
+
+
+
+
+ hedge
+ objectarray
+
+ Specifies whether to use hedged reads, which are supported by MongoDB 4.4+ for sharded queries.
+
+ Server hedged reads are available for all non-primary read preferences
+ and are enabled by default when using the "nearest"
+ mode. This option allows explicitly enabling server hedged reads for
+ non-primary read preferences by specifying
+ ['enabled' => true], or explicitly disabling
+ server hedged reads for the "nearest" read
+ preference by specifying ['enabled' => false].
+
+
+
+
+ maxStalenessSeconds
+ int
+
+
+ Specifies a maximum replication lag, or "staleness", for reads from
+ secondaries. When a secondary's estimated staleness exceeds
+ this value, the driver stops using it for read operations.
+
+
+ If specified, the max staleness must be a signed 32-bit integer
+ greater than or equal to
+ MongoDB\Driver\ReadPreference::SMALLEST_MAX_STALENESS_SECONDS.
+
+
+ Defaults to
+ MongoDB\Driver\ReadPreference::NO_MAX_STALENESS,
+ which means that the driver will not consider a secondary's lag
+ when choosing where to direct a read operation.
+
+
+ This option is not compatible with the "primary"
+ mode. Specifying a max staleness also requires all MongoDB instances
+ in the deployment to be using MongoDB 3.4+. An exception will be
+ thrown at execution time if any MongoDB instances in the deployment
+ are of an older server version.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\InvalidArgumentException if mode is invalid.
+ Throws MongoDB\Driver\Exception\InvalidArgumentException if tagSets is provided for a primary read preference or is malformed (i.e. not an array of zero or more documents).
+ Throws MongoDB\Driver\Exception\InvalidArgumentException if the "maxStalenessSeconds" option is provided for a primary read preference or is out of range.
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+ Passing an int for the mode argument
+ is no longer supported.
+
+
+
+ PECL mongodb 1.20.0
+
+ Passing an int for the mode argument
+ is DEPRECATED.
+
+
+
+ PECL mongodb 1.8.0
+
+ Added the "hedge" option.
+
+
+
+ PECL mongodb 1.3.0
+
+
+ The mode argument now accepts a string value,
+ which is consistent with the "readPreference" URI
+ option for MongoDB\Driver\Manager::__construct.
+
+
+
+
+ PECL mongodb 1.2.0
+
+
+ Added a third options argument, which supports
+ the "maxStalenessSeconds" option.
+
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadPreference::__construct の例
+
+ 'ny']]));
+
+/* Require a secondary node whose replication lag is within two minutes of the primary */
+var_dump(new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::SECONDARY, null, ['maxStalenessSeconds' => 120]));
+
+/* Explicitly enable server hedged reads */
+var_dump(new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::SECONDARY, null, ['hedge' => ['enabled' => true]]));
+
+?>
+]]>
+
+ &example.outputs;
+
+
+ string(18) "secondaryPreferred"
+}
+object(MongoDB\Driver\ReadPreference)#1 (2) {
+ ["mode"]=>
+ string(7) "nearest"
+ ["tags"]=>
+ array(1) {
+ [0]=>
+ object(stdClass)#2 (1) {
+ ["dc"]=>
+ string(2) "ny"
+ }
+ }
+}
+object(MongoDB\Driver\ReadPreference)#1 (2) {
+ ["mode"]=>
+ string(9) "secondary"
+ ["maxStalenessSeconds"]=>
+ int(120)
+}
+object(MongoDB\Driver\ReadPreference)#1 (2) {
+ ["mode"]=>
+ string(9) "secondary"
+ ["hedge"]=>
+ object(stdClass)#1 (1) {
+ ["enabled"]=>
+ bool(true)
+ }
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Read Preference reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readpreference/gethedge.xml b/reference/mongodb/mongodb/driver/readpreference/gethedge.xml
new file mode 100644
index 0000000000..56a65abb47
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readpreference/gethedge.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::getHedge
+ ReadPreference の "hedge" option を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectnullMongoDB\Driver\ReadPreference::getHedge
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the ReadPreference's "hedge" option.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.seealso;
+
+ Read Preference reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readpreference/getmaxstalenessseconds.xml b/reference/mongodb/mongodb/driver/readpreference/getmaxstalenessseconds.xml
new file mode 100644
index 0000000000..a2004d29f4
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readpreference/getmaxstalenessseconds.xml
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::getMaxStalenessSeconds
+ ReadPreference の "maxStalenessSeconds" option を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\ReadPreference::getMaxStalenessSeconds
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the ReadPreference's "maxStalenessSeconds" option. If no max
+ staleness has been specified,
+ MongoDB\Driver\ReadPreference::NO_MAX_STALENESS will be
+ returned.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadPreference::getMaxStalenessSeconds の例
+
+getMaxStalenessSeconds());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::SECONDARY, null, [
+ 'maxStalenessSeconds' => MongoDB\Driver\ReadPreference::NO_MAX_STALENESS,
+]);
+var_dump($rp->getMaxStalenessSeconds());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::SECONDARY, null, [
+ 'maxStalenessSeconds' => MongoDB\Driver\ReadPreference::SMALLEST_MAX_STALENESS_SECONDS,
+]);
+var_dump($rp->getMaxStalenessSeconds());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::SECONDARY, null, [
+ 'maxStalenessSeconds' => 1000,
+]);
+var_dump($rp->getMaxStalenessSeconds());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Read Preference reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readpreference/getmode.xml b/reference/mongodb/mongodb/driver/readpreference/getmode.xml
new file mode 100644
index 0000000000..9a09b899c5
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readpreference/getmode.xml
@@ -0,0 +1,137 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::getMode
+ ReadPreference の "mode" option を返す
+
+
+
+
+
+ This function has been DEPRECATED as of extension
+ version 1.20.0 and was removed in 2.0. Applications should use
+ MongoDB\Driver\ReadPreference::getModeString
+ instead.
+
+
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\ReadPreference::getMode
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the ReadPreference's "mode" option.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.method-removed;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadPreference::getMode の例
+
+getMode());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::PRIMARY_PREFERRED);
+var_dump($rp->getMode());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::SECONDARY);
+var_dump($rp->getMode());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::SECONDARY_PREFERRED);
+var_dump($rp->getMode());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::NEAREST);
+var_dump($rp->getMode());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ReadPreference::getModeString
+ Read Preference reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readpreference/getmodestring.xml b/reference/mongodb/mongodb/driver/readpreference/getmodestring.xml
new file mode 100644
index 0000000000..5a2ae669ce
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readpreference/getmodestring.xml
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::getModeString
+ ReadPreference の "mode" option を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\ReadPreference::getModeString
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the ReadPreference's "mode" option as a string.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadPreference::getModeString の例
+
+getModeString());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::PRIMARY_PREFERRED);
+var_dump($rp->getModeString());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::SECONDARY);
+var_dump($rp->getModeString());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::SECONDARY_PREFERRED);
+var_dump($rp->getModeString());
+
+$rp = new MongoDB\Driver\ReadPreference(MongoDB\Driver\ReadPreference::NEAREST);
+var_dump($rp->getModeString());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ReadPreference::getMode
+ Read Preference reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/readpreference/gettagsets.xml b/reference/mongodb/mongodb/driver/readpreference/gettagsets.xml
new file mode 100644
index 0000000000..7c27f14111
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/readpreference/gettagsets.xml
@@ -0,0 +1,140 @@
+
+
+
+
+
+
+ MongoDB\Driver\ReadPreference::getTagSets
+ ReadPreference の "tagSets" option を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\ReadPreference::getTagSets
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the ReadPreference's "tagSets" option.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\ReadPreference::getTagSets の例
+
+getTagSets());
+
+$rp = new MongoDB\Driver\ReadPreference($mode, []);
+var_dump($rp->getTagSets());
+
+/* Prefer a node in New York, but fall back to any available node. */
+$rp = new MongoDB\Driver\ReadPreference($mode, [['dc' => 'ny']]);
+var_dump($rp->getTagSets());
+
+/* Prefer a node in the New York, followed by a node in San Francisco that is
+ labeled for reporting usage, and finally fall back to any available node. */
+$rp = new MongoDB\Driver\ReadPreference($mode, [
+ ['dc' => 'ny'],
+ ['dc' => 'sf', 'use' => 'reporting'],
+ [],
+]);
+var_dump($rp->getTagSets());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+ array(1) {
+ ["dc"]=>
+ string(2) "ny"
+ }
+ [1]=>
+ array(0) {
+ }
+}
+array(3) {
+ [0]=>
+ array(1) {
+ ["dc"]=>
+ string(2) "ny"
+ }
+ [1]=>
+ array(2) {
+ ["dc"]=>
+ string(2) "sf"
+ ["use"]=>
+ string(9) "reporting"
+ }
+ [2]=>
+ array(0) {
+ }
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Read Preference reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server.xml b/reference/mongodb/mongodb/driver/server.xml
new file mode 100644
index 0000000000..bb880e8417
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server.xml
@@ -0,0 +1,240 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server クラス
+ MongoDB\Driver\Server
+
+
+
+
+
+ &reftitle.intro;
+
+
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Server
+
+
+
+ final
+
+ MongoDB\Driver\Server
+
+
+
+ &Constants;
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_UNKNOWN
+ 0
+
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_STANDALONE
+ 1
+
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_MONGOS
+ 2
+
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_POSSIBLE_PRIMARY
+ 3
+
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_RS_PRIMARY
+ 4
+
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_RS_SECONDARY
+ 5
+
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_RS_ARBITER
+ 6
+
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_RS_OTHER
+ 7
+
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_RS_GHOST
+ 8
+
+
+ const
+ int
+ MongoDB\Driver\Server::TYPE_LOAD_BALANCER
+ 9
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+
+ MongoDB\Driver\Server::TYPE_UNKNOWN
+
+ Unknown server type, returned by MongoDB\Driver\Server::getType.
+
+
+
+
+ MongoDB\Driver\Server::TYPE_STANDALONE
+
+ Standalone server type, returned by MongoDB\Driver\Server::getType.
+
+
+
+
+ MongoDB\Driver\Server::TYPE_MONGOS
+
+ Mongos server type, returned by MongoDB\Driver\Server::getType.
+
+
+
+
+ MongoDB\Driver\Server::TYPE_POSSIBLE_PRIMARY
+
+ Replica set possible primary server type, returned by MongoDB\Driver\Server::getType.
+ A server may be identified as a possible primary if it has not yet been checked but another memory of the replica set thinks it is the primary.
+
+
+
+
+ MongoDB\Driver\Server::TYPE_RS_PRIMARY
+
+ Replica set primary server type, returned by MongoDB\Driver\Server::getType.
+
+
+
+
+ MongoDB\Driver\Server::TYPE_RS_SECONDARY
+
+ Replica set secondary server type, returned by MongoDB\Driver\Server::getType.
+
+
+
+
+ MongoDB\Driver\Server::TYPE_RS_ARBITER
+
+ Replica set arbiter server type, returned by MongoDB\Driver\Server::getType.
+
+
+
+
+ MongoDB\Driver\Server::TYPE_RS_OTHER
+
+ Replica set other server type, returned by MongoDB\Driver\Server::getType.
+ Such servers may be hidden, starting up, or recovering. They cannot be queried, but their hosts lists are useful for discovering the current replica set configuration.
+
+
+
+
+ MongoDB\Driver\Server::TYPE_RS_GHOST
+
+ Replica set ghost server type, returned by MongoDB\Driver\Server::getType.
+ Servers may be identified as such in at least three situations: briefly during server startup; in an uninitialized replica set; or when the server is shunned (i.e. removed from the replica set config). They cannot be queried, nor can their host list be used to discover the current replica set configuration; however, the client may monitor this server in hope that it transitions to a more useful state.
+
+
+
+
+ MongoDB\Driver\Server::TYPE_LOAD_BALANCER
+
+ Load balancer server type, returned by MongoDB\Driver\Server::getType.
+
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.11.0
+
+
+ Added the
+ MongoDB\Driver\Server::TYPE_LOAD_BALANCER
+ constant.
+
+
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.server;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/construct.xml b/reference/mongodb/mongodb/driver/server/construct.xml
new file mode 100644
index 0000000000..646905da05
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/construct.xml
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::__construct
+ 新しい Server (not used) を作成する
+
+
+
+ &reftitle.description;
+
+ finalprivateMongoDB\Driver\Server::__construct
+
+
+
+ MongoDB\Driver\Server objects are created internally
+ by MongoDB\Driver\Manager when a database connection
+ is established and may be returned by
+ MongoDB\Driver\Manager::getServers and
+ MongoDB\Driver\Manager::selectServer.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::getServers
+ MongoDB\Driver\Manager::selectServer
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/executebulkwrite.xml b/reference/mongodb/mongodb/driver/server/executebulkwrite.xml
new file mode 100644
index 0000000000..c5a960c660
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/executebulkwrite.xml
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::executeBulkWrite
+ このサーバー上で1つ以上の書き込み操作を実行する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\WriteResultMongoDB\Driver\Server::executeBulkWrite
+ stringnamespace
+ MongoDB\Driver\BulkWritebulk
+ arraynulloptions&null;
+
+
+ Executes one or more write operations on this server.
+
+
+ A MongoDB\Driver\BulkWrite can be constructed with
+ one or more write operations of varying types (e.g. updates, deletes, and
+ inserts). The driver will attempt to send operations of the same type to the
+ server in as few requests as possible to optimize round trips.
+
+
+ The default value for the "writeConcern" option will be
+ inferred from an active transaction (indicated by the
+ "session" option), followed by the
+ connection URI.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.namespace;
+ &mongodb.parameter.bulkwrite;
+
+ options
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+ &mongodb.returns.writeresult;
+
+
+
+ &reftitle.errors;
+
+ Throws MongoDB\Driver\Exception\InvalidArgumentException if bulk does not contain any write operations.
+ Throws MongoDB\Driver\Exception\InvalidArgumentException if bulk has already been executed. MongoDB\Driver\BulkWrite objects may not be executed multiple times.
+ &mongodb.throws.session-unacknowledged;
+ &mongodb.throws.std;
+ &mongodb.throws.bulkwriteexception;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 2.0.0
+
+ The options parameter no longer accepts a
+ MongoDB\Driver\WriteConcern instance.
+
+
+
+ PECL mongodb 1.21.0
+
+ Passing a MongoDB\Driver\WriteConcern object as
+ options is deprecated and will be removed in 2.0.
+
+
+
+ PECL mongodb 1.4.4
+
+ MongoDB\Driver\Exception\InvalidArgumentException
+ will be thrown if the "session" option is used in
+ combination with an unacknowledged write concern.
+
+
+
+ PECL mongodb 1.4.0
+
+ The third parameter is now an options array.
+ For backwards compatibility, this paramater will still accept a
+ MongoDB\Driver\WriteConcern object.
+
+
+
+ PECL mongodb 1.3.0
+
+ MongoDB\Driver\Exception\InvalidArgumentException
+ is now thrown if bulk does not contain any write
+ operations. Previously, a
+ MongoDB\Driver\Exception\BulkWriteException was
+ thrown.
+
+
+
+
+
+
+
+
+
+ &reftitle.notes;
+ &mongodb.note.server.write;
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWrite
+ MongoDB\Driver\WriteResult
+ MongoDB\Driver\WriteConcern
+ MongoDB\Driver\Manager::executeBulkWrite
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/executebulkwritecommand.xml b/reference/mongodb/mongodb/driver/server/executebulkwritecommand.xml
new file mode 100644
index 0000000000..25d454f4b7
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/executebulkwritecommand.xml
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::executeBulkWriteCommand
+ このサーバー上で bulkWrite コマンドを使用して書き込み操作を実行する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\BulkWriteCommandResultMongoDB\Driver\Server::executeBulkWriteCommand
+ MongoDB\Driver\BulkWriteCommandbulk
+ arraynulloptions&null;
+
+
+ Executes one or more write operations on this server using the
+ bulkWrite
+ command introduced in MongoDB 8.0.
+
+
+ A MongoDB\Driver\BulkWriteCommand can be constructed
+ with one or more write operations of varying types (e.g. inserts, updates,
+ and deletes). Each write operation may target a different collection.
+
+
+ The default value for the "writeConcern" option will be
+ inferred from an active transaction (indicated by the
+ "session" option), followed by the
+ connection URI.
+
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.bulkwritecommand;
+
+ options
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+ &mongodb.returns.bulkwritecommandresult;
+
+
+
+ &reftitle.errors;
+
+ Throws MongoDB\Driver\Exception\InvalidArgumentException if bulk does not contain any write operations.
+ Throws MongoDB\Driver\Exception\InvalidArgumentException if bulk has already been executed. MongoDB\Driver\BulkWriteCommand objects may not be executed multiple times.
+ &mongodb.throws.session-unacknowledged;
+ &mongodb.throws.std;
+ &mongodb.throws.bulkwritecommandexception;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors.
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWriteCommand
+ MongoDB\Driver\BulkWriteCommandResult
+ MongoDB\Driver\WriteConcern
+ MongoDB\Driver\Manager::executeBulkWriteCommand
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/executecommand.xml b/reference/mongodb/mongodb/driver/server/executecommand.xml
new file mode 100644
index 0000000000..fe3dfb84fe
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/executecommand.xml
@@ -0,0 +1,174 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::executeCommand
+ このサーバー上でデータベースコマンドを実行する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\CursorMongoDB\Driver\Server::executeCommand
+ stringdb
+ MongoDB\Driver\Commandcommand
+ arraynulloptions&null;
+
+
+ Executes the command on this server.
+
+
+ This method applies no special logic to the command. The
+ Default values for the "readPreference",
+ "readConcern", and "writeConcern"
+ options will be inferred from an active transaction (indicated by the
+ "session" option). If there is no active transaction, a
+ primary read preference will be used for server selection.
+
+
+ Default values will not be inferred from the
+ connection URI.
+ Users are therefore encouraged to use specific read and/or write command
+ methods if possible.
+
+ &mongodb.note.server.readpreference;
+
+
+
+ &reftitle.parameters;
+
+ &mongodb.parameter.db;
+ &mongodb.parameter.command;
+
+ options
+
+
+
+
+ &mongodb.option.transactionReadWriteConcern;
+
+
+
+
+
+
+ &reftitle.returnvalues;
+ &mongodb.returns.cursor;
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.session-readwriteconcern;
+ &mongodb.throws.session-unacknowledged;
+ &mongodb.throws.std;
+ Throws MongoDB\Driver\Exception\RuntimeException on other errors (e.g. invalid command).
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.4.4
+
+ MongoDB\Driver\Exception\InvalidArgumentException
+ will be thrown if the "session" option is used in
+ combination with an unacknowledged write concern.
+
+
+
+
+
+
+
+
+
+ &reftitle.notes;
+ &mongodb.note.server.write;
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Command
+ MongoDB\Driver\Cursor
+ MongoDB\Driver\Server::executeCommand
+ MongoDB\Driver\Server::executeReadCommand
+ MongoDB\Driver\Server::executeReadWriteCommand
+ MongoDB\Driver\Manager::executeWriteCommand
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/gethost.xml b/reference/mongodb/mongodb/driver/server/gethost.xml
new file mode 100644
index 0000000000..0b6a9b625f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/gethost.xml
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::getHost
+ hostname of this server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Server::getHost
+
+
+
+ Returns the hostname of this server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of this server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Server::getHost の例
+
+selectServer();
+
+var_dump($server->getHost());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+ MongoDB\Driver\ServerDescription::getHost
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/getinfo.xml b/reference/mongodb/mongodb/driver/server/getinfo.xml
new file mode 100644
index 0000000000..e16d2c3d17
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/getinfo.xml
@@ -0,0 +1,263 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::getInfo
+ array of information describing this server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\Server::getInfo
+
+
+
+ Returns an array of information describing the server. This array is derived
+ from the most recent
+ hello
+ command response obtained through
+ server monitoring.
+
+
+
+ When the driver is connected to a load balancer, this method will return
+ the backing server's
+ hello
+ command response from the initial connection handshake. This is in contrast
+ to other methods (e.g. MongoDB\Driver\Server::getType),
+ which will return information about the load balancer itself.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array of information describing this server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Server::getInfo の例
+
+selectServer($rp);
+
+var_dump($server->getInfo());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ bool(true)
+ ["topologyVersion"]=>
+ array(2) {
+ ["processId"]=>
+ object(MongoDB\BSON\ObjectId)#4 (1) {
+ ["oid"]=>
+ string(24) "617b6d696a3a89d2f77e6df0"
+ }
+ ["counter"]=>
+ int(6)
+ }
+ ["hosts"]=>
+ array(1) {
+ [0]=>
+ string(15) "localhost:27017"
+ }
+ ["setName"]=>
+ string(3) "rs0"
+ ["setVersion"]=>
+ int(1)
+ ["ismaster"]=>
+ bool(true)
+ ["secondary"]=>
+ bool(false)
+ ["primary"]=>
+ string(15) "localhost:27017"
+ ["me"]=>
+ string(15) "localhost:27017"
+ ["electionId"]=>
+ object(MongoDB\BSON\ObjectId)#5 (1) {
+ ["oid"]=>
+ string(24) "7fffffff0000000000000001"
+ }
+ ["lastWrite"]=>
+ array(4) {
+ ["opTime"]=>
+ array(2) {
+ ["ts"]=>
+ object(MongoDB\BSON\Timestamp)#6 (2) {
+ ["increment"]=>
+ string(1) "1"
+ ["timestamp"]=>
+ string(10) "1635478989"
+ }
+ ["t"]=>
+ int(1)
+ }
+ ["lastWriteDate"]=>
+ object(MongoDB\BSON\UTCDateTime)#7 (1) {
+ ["milliseconds"]=>
+ string(13) "1635478989000"
+ }
+ ["majorityOpTime"]=>
+ array(2) {
+ ["ts"]=>
+ object(MongoDB\BSON\Timestamp)#8 (2) {
+ ["increment"]=>
+ string(1) "1"
+ ["timestamp"]=>
+ string(10) "1635478989"
+ }
+ ["t"]=>
+ int(1)
+ }
+ ["majorityWriteDate"]=>
+ object(MongoDB\BSON\UTCDateTime)#9 (1) {
+ ["milliseconds"]=>
+ string(13) "1635478989000"
+ }
+ }
+ ["maxBsonObjectSize"]=>
+ int(16777216)
+ ["maxMessageSizeBytes"]=>
+ int(48000000)
+ ["maxWriteBatchSize"]=>
+ int(100000)
+ ["localTime"]=>
+ object(MongoDB\BSON\UTCDateTime)#10 (1) {
+ ["milliseconds"]=>
+ string(13) "1635478992136"
+ }
+ ["logicalSessionTimeoutMinutes"]=>
+ int(30)
+ ["connectionId"]=>
+ int(3)
+ ["minWireVersion"]=>
+ int(0)
+ ["maxWireVersion"]=>
+ int(13)
+ ["readOnly"]=>
+ bool(false)
+ ["ok"]=>
+ float(1)
+ ["$clusterTime"]=>
+ array(2) {
+ ["clusterTime"]=>
+ object(MongoDB\BSON\Timestamp)#11 (2) {
+ ["increment"]=>
+ string(1) "1"
+ ["timestamp"]=>
+ string(10) "1635478989"
+ }
+ ["signature"]=>
+ array(2) {
+ ["hash"]=>
+ object(MongoDB\BSON\Binary)#12 (2) {
+ ["data"]=>
+ string(20) ""
+ ["type"]=>
+ int(0)
+ }
+ ["keyId"]=>
+ int(0)
+ }
+ }
+ ["operationTime"]=>
+ object(MongoDB\BSON\Timestamp)#13 (2) {
+ ["increment"]=>
+ string(1) "1"
+ ["timestamp"]=>
+ string(10) "1635478989"
+ }
+}
+]]>
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.11.0
+
+ When the driver is connected to a load balancer, this method returns
+ the backing server's hello command response from the
+ initial connection handshake.
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\ServerDescription::getHelloResponse
+ hello command in the MongoDB manual
+ Server Discovery and Monitoring Specification
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/getlatency.xml b/reference/mongodb/mongodb/driver/server/getlatency.xml
new file mode 100644
index 0000000000..01c46c8c32
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/getlatency.xml
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::getLatency
+ latency of this server in milliseconds を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintegernullMongoDB\Driver\Server::getLatency
+
+
+
+ Returns the latency of this server in milliseconds. This is the client's
+ measured
+ round trip time
+ of a hello command.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the latency of this server in milliseconds, or &null; if no latency
+ has been measured (e.g. client is connected to a load balancer).
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.11.0
+
+ This method will return &null; if no latency has been measured. In
+ earlier versions, an integer was always returned and an unset value
+ might be reported as -1.
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Server::getLatency の例
+
+selectServer();
+
+var_dump($server->getLatency());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+ MongoDB\Driver\ServerDescription::getRoundTripTime
+ Server Discovery and Monitoring Specification
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/getport.xml b/reference/mongodb/mongodb/driver/server/getport.xml
new file mode 100644
index 0000000000..640c0cca0d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/getport.xml
@@ -0,0 +1,97 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::getPort
+ port on which this server is listening を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Server::getPort
+
+
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\Server::getPort の例
+
+selectServer();
+
+var_dump($server->getPort());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+ MongoDB\Driver\ServerDescription::getPort
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/getserverdescription.xml b/reference/mongodb/mongodb/driver/server/getserverdescription.xml
new file mode 100644
index 0000000000..cfd9b82416
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/getserverdescription.xml
@@ -0,0 +1,65 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::getServerDescription
+ ServerDescription for this server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerDescriptionMongoDB\Driver\Server::getServerDescription
+
+
+
+ Returns a MongoDB\Driver\ServerDescription for this
+ server. This is an immutable value object that will describe the server at
+ the time this method is called.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a MongoDB\Driver\ServerDescription for this
+ server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/gettags.xml b/reference/mongodb/mongodb/driver/server/gettags.xml
new file mode 100644
index 0000000000..7221ab01ea
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/gettags.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::getTags
+ array of tags describing this server in a replica set を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\Server::getTags
+
+
+
+ Returns an array of
+ tags used to
+ describe this server in a replica set. The array will contain zero or more
+ string key and value pairs.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array of tags used to describe this server in a
+ replica set.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/gettype.xml b/reference/mongodb/mongodb/driver/server/gettype.xml
new file mode 100644
index 0000000000..3a29dd3cd1
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/gettype.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::getType
+ integer denoting the type of this server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\Server::getType
+
+
+
+ Returns an int denoting the type of this server. The value
+ will correlate with a MongoDB\Driver\Server constant.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an int denoting the type of this server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+ MongoDB\Driver\ServerDescription::getType
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/isarbiter.xml b/reference/mongodb/mongodb/driver/server/isarbiter.xml
new file mode 100644
index 0000000000..c4dfb74685
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/isarbiter.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::isArbiter
+ this server is an arbiter member of a replica set かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Server::isArbiter
+
+
+
+ Returns whether this server is an
+ arbiter member
+ of a replica set.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if this server is an arbiter member of a replica set, and
+ &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/ishidden.xml b/reference/mongodb/mongodb/driver/server/ishidden.xml
new file mode 100644
index 0000000000..6ee4d11065
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/ishidden.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::isHidden
+ this server is a hidden member of a replica set かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Server::isHidden
+
+
+
+ Returns whether this server is a
+ hidden member
+ of a replica set.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if this server is a hidden member of a replica set, and
+ &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/ispassive.xml b/reference/mongodb/mongodb/driver/server/ispassive.xml
new file mode 100644
index 0000000000..d71ed636ef
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/ispassive.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::isPassive
+ this server is a passive member of a replica set かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Server::isPassive
+
+
+
+ Returns whether this server is a
+ passive member
+ of a replica set (i.e. its priority is 0).
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if this server is a passive member of a replica set, and
+ &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/isprimary.xml b/reference/mongodb/mongodb/driver/server/isprimary.xml
new file mode 100644
index 0000000000..6328b13b54
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/isprimary.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::isPrimary
+ this server is a primary member of a replica set かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Server::isPrimary
+
+
+
+ Returns whether this server is a
+ primary member
+ of a replica set.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if this server is a primary member of a replica set, and
+ &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/server/issecondary.xml b/reference/mongodb/mongodb/driver/server/issecondary.xml
new file mode 100644
index 0000000000..db0e2103bb
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/server/issecondary.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Server::isSecondary
+ this server is a secondary member of a replica set かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Server::isSecondary
+
+
+
+ Returns whether this server is a
+ secondary member
+ of a replica set.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if this server is a secondary member of a replica set, and
+ &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverapi.xml b/reference/mongodb/mongodb/driver/serverapi.xml
new file mode 100644
index 0000000000..c5ad42fdee
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverapi.xml
@@ -0,0 +1,186 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerApi クラス
+ MongoDB\Driver\ServerApi
+
+
+
+
+
+ &reftitle.intro;
+
+
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\ServerApi
+
+
+
+ final
+
+ MongoDB\Driver\ServerApi
+
+
+ MongoDB\BSON\Serializable
+
+
+
+ Serializable
+
+
+
+ &Constants;
+
+ const
+ string
+ MongoDB\Driver\ServerAPI::V1
+ "1"
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+
+ MongoDB\Driver\ServerApi::V1
+
+ Server API version 1.
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+
+ Declare an API version on a manager
+
+ $v1]);
+
+$command = new MongoDB\Driver\Command(['buildInfo' => 1]);
+
+try {
+ $cursor = $manager->executeCommand('admin', $command);
+} catch(MongoDB\Driver\Exception $e) {
+ echo $e->getMessage(), "\n";
+ exit;
+}
+
+/* The buildInfo command returns a single result document, so we need to access
+ * the first result in the cursor. */
+$buildInfo = $cursor->toArray()[0];
+
+echo $buildInfo->version, "\n";
+
+?>
+]]>
+
+
+ &example.outputs;
+
+
+
+
+
+
+ Declare a strict API version on a manager
+
+ The following example sets the strict flag, which
+ tells the server to reject any command that is not part of the declared API
+ version. This results in an error when running the buildInfo command.
+
+
+ $v1]);
+
+$command = new MongoDB\Driver\Command(['buildInfo' => 1]);
+
+try {
+ $cursor = $manager->executeCommand('admin', $command);
+} catch(MongoDB\Driver\Exception $e) {
+ echo $e->getMessage(), "\n";
+ exit;
+}
+
+/* The buildInfo command returns a single result document, so we need to access
+ * the first result in the cursor. */
+$buildInfo = $cursor->toArray()[0];
+
+echo $buildInfo->version, "\n";
+
+?>
+]]>
+
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.serverapi;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverapi/bsonserialize.xml b/reference/mongodb/mongodb/driver/serverapi/bsonserialize.xml
new file mode 100644
index 0000000000..1283f16e65
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverapi/bsonserialize.xml
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerApi::bsonSerialize
+ object for BSON serialization を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstdClassMongoDB\Driver\ServerApi::bsonSerialize
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an object for serializing the ServerApi as BSON.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\BSON\Serializable::bsonSerialize
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverapi/construct.xml b/reference/mongodb/mongodb/driver/serverapi/construct.xml
new file mode 100644
index 0000000000..48a36ca0b9
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverapi/construct.xml
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerApi::__construct
+ 新しい ServerApi instance を作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerApi::__construct
+ stringversion
+ boolnullstrict&null;
+ boolnulldeprecationErrors&null;
+
+
+
+ Creates a new MongoDB\Driver\ServerApi instance used to
+ declare an API version when creating a
+ MongoDB\Driver\Manager.
+
+
+
+
+ &reftitle.parameters;
+
+
+ version
+
+
+ A server API version.
+
+
+ Supported API versions are provided as constants in
+ MongoDB\Driver\ServerApi. The only supported API
+ version is MongoDB\Driver\ServerApi::V1.
+
+
+
+
+ strict
+
+
+ If the strict parameter is set to &true;, the
+ server will yield an error for any command that is not part of the
+ specified API version. If no value is provided, the server default value
+ (&false;) is used.
+
+
+
+
+ deprecationErrors
+
+
+ If the deprecationErrors parameter is set to &true;,
+ the server will yield an error when using a command that is deprecated in
+ the specified API version. If no value is provided, the server default value
+ (&false;) is used.
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverdescription.xml b/reference/mongodb/mongodb/driver/serverdescription.xml
new file mode 100644
index 0000000000..8bf39a47cc
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverdescription.xml
@@ -0,0 +1,216 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerDescription クラス
+ MongoDB\Driver\ServerDescription
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\ServerDescription class is a value
+ object that represents a server to which the driver is connected. Instances
+ of this class are returned by
+ MongoDB\Driver\Server::getServerDescription and
+ MongoDB\Driver\Monitoring\ServerChangedEvent methods.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\ServerDescription
+
+
+
+ final
+
+ MongoDB\Driver\ServerDescription
+
+
+
+ &Constants;
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_UNKNOWN
+ "Unknown"
+
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_STANDALONE
+ "Standalone"
+
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_MONGOS
+ "Mongos"
+
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_POSSIBLE_PRIMARY
+ "PossiblePrimary"
+
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_RS_PRIMARY
+ "RSPrimary"
+
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_RS_SECONDARY
+ "RSSecondary"
+
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_RS_ARBITER
+ "RSArbiter"
+
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_RS_OTHER
+ "RSOther"
+
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_RS_GHOST
+ "RSGhost"
+
+
+ const
+ string
+ MongoDB\Driver\ServerDescription::TYPE_LOAD_BALANCER
+ "LoadBalancer"
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_UNKNOWN
+
+ Unknown server type, returned by MongoDB\Driver\ServerDescription::getType.
+
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_STANDALONE
+
+ Standalone server type, returned by MongoDB\Driver\ServerDescription::getType.
+
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_MONGOS
+
+ Mongos server type, returned by MongoDB\Driver\ServerDescription::getType.
+
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_POSSIBLE_PRIMARY
+
+ Replica set possible primary server type, returned by MongoDB\Driver\ServerDescription::getType.
+ A server may be identified as a possible primary if it has not yet been checked but another memory of the replica set thinks it is the primary.
+
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_RS_PRIMARY
+
+ Replica set primary server type, returned by MongoDB\Driver\ServerDescription::getType.
+
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_RS_SECONDARY
+
+ Replica set secondary server type, returned by MongoDB\Driver\ServerDescription::getType.
+
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_RS_ARBITER
+
+ Replica set arbiter server type, returned by MongoDB\Driver\ServerDescription::getType.
+
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_RS_OTHER
+
+ Replica set other server type, returned by MongoDB\Driver\ServerDescription::getType.
+ Such servers may be hidden, starting up, or recovering. They cannot be queried, but their hosts lists are useful for discovering the current replica set configuration.
+
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_RS_GHOST
+
+ Replica set ghost server type, returned by MongoDB\Driver\ServerDescription::getType.
+ Servers may be identified as such in at least three situations: briefly during server startup; in an uninitialized replica set; or when the server is shunned (i.e. removed from the replica set config). They cannot be queried, nor can their host list be used to discover the current replica set configuration; however, the client may monitor this server in hope that it transitions to a more useful state.
+
+
+
+
+ MongoDB\Driver\ServerDescription::TYPE_LOAD_BALANCER
+
+ Load balancer server type, returned by MongoDB\Driver\ServerDescription::getType.
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.serverdescription;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverdescription/gethelloresponse.xml b/reference/mongodb/mongodb/driver/serverdescription/gethelloresponse.xml
new file mode 100644
index 0000000000..d1619c4a40
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverdescription/gethelloresponse.xml
@@ -0,0 +1,86 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerDescription::getHelloResponse
+ server's most recent "hello" response を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\ServerDescription::getHelloResponse
+
+
+
+ Returns an array of information describing the server. This array is derived
+ from the most recent (at the time the
+ MongoDB\Driver\ServerDescription was constructed)
+ hello
+ command response obtained through
+ server monitoring.
+
+
+
+ When the driver is connected to a load balancer, this method will return an
+ empty array since load balancers are not monitored. This is in contrast to
+ MongoDB\Driver\Server::getInfo, which would return the
+ backing server's
+ hello
+ command response from the initial connection handshake.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array of information describing this server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getInfo
+ hello command in the MongoDB manual
+ Server Discovery and Monitoring Specification
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverdescription/gethost.xml b/reference/mongodb/mongodb/driver/serverdescription/gethost.xml
new file mode 100644
index 0000000000..3f8f7b20f5
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverdescription/gethost.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerDescription::getHost
+ hostname of this server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\ServerDescription::getHost
+
+
+
+ Returns the hostname of this server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the hostname of this server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getHost
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverdescription/getlastupdatetime.xml b/reference/mongodb/mongodb/driver/serverdescription/getlastupdatetime.xml
new file mode 100644
index 0000000000..906585f8da
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverdescription/getlastupdatetime.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerDescription::getLastUpdateTime
+ server's last update time in microseconds を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\ServerDescription::getLastUpdateTime
+
+
+
+ Returns the server's last update time in microseconds.
+
+
+
+ The returned value is a monotonic timestamp, which starts at an arbitrary
+ point. As such, it is only suitable to compare with other return values from
+ MongoDB\Driver\ServerDescription::getLastUpdateTime.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the server's last update time in microseconds.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverdescription/getport.xml b/reference/mongodb/mongodb/driver/serverdescription/getport.xml
new file mode 100644
index 0000000000..ce20341afb
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverdescription/getport.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerDescription::getPort
+ port on which this server is listening を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\ServerDescription::getPort
+
+
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the port on which this server is listening.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getPort
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverdescription/getroundtriptime.xml b/reference/mongodb/mongodb/driver/serverdescription/getroundtriptime.xml
new file mode 100644
index 0000000000..97cfa126dd
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverdescription/getroundtriptime.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerDescription::getRoundTripTime
+ server's round trip time in milliseconds を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintnullMongoDB\Driver\ServerDescription::getRoundTripTime
+
+
+
+ Returns the server's round trip time in milliseconds. This is the client's
+ measurement of the duration of a
+ hello
+ command.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the server's round trip time in milliseconds.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getLatency
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/serverdescription/gettype.xml b/reference/mongodb/mongodb/driver/serverdescription/gettype.xml
new file mode 100644
index 0000000000..b1d58249a4
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/serverdescription/gettype.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\ServerDescription::getType
+ string denoting the type of this server を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\ServerDescription::getType
+
+
+
+ Returns a string denoting the type of this server. The value
+ will correlate with a MongoDB\Driver\ServerDescription
+ constant.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a string denoting the type of this server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server::getType
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session.xml b/reference/mongodb/mongodb/driver/session.xml
new file mode 100644
index 0000000000..e4c74d7704
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session.xml
@@ -0,0 +1,158 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session クラス
+ MongoDB\Driver\Session
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\Session class represents a
+ client session and is returned by
+ MongoDB\Driver\Manager::startSession. Commands,
+ queries, and write operations may then be associated the session.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\Session
+
+
+
+ final
+
+ MongoDB\Driver\Session
+
+
+
+
+ &Constants;
+
+ const
+ string
+ MongoDB\Driver\Session::TRANSACTION_NONE
+ none
+
+
+ const
+ string
+ MongoDB\Driver\Session::TRANSACTION_STARTING
+ starting
+
+
+ const
+ string
+ MongoDB\Driver\Session::TRANSACTION_IN_PROGRESS
+ in_progress
+
+
+ const
+ string
+ MongoDB\Driver\Session::TRANSACTION_COMMITTED
+ committed
+
+
+ const
+ string
+ MongoDB\Driver\Session::TRANSACTION_ABORTED
+ aborted
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+
+ MongoDB\Driver\Session::TRANSACTION_NONE
+
+
+ There is no transaction in progress.
+
+
+
+
+
+ MongoDB\Driver\Session::TRANSACTION_STARTING
+
+
+ A transaction has been started, but no operation has been sent to the server.
+
+
+
+
+
+ MongoDB\Driver\Session::TRANSACTION_IN_PROGRESS
+
+
+ A transaction is in progress.
+
+
+
+
+
+ MongoDB\Driver\Session::TRANSACTION_COMMITTED
+
+
+ The transaction was committed.
+
+
+
+
+
+ MongoDB\Driver\Session::TRANSACTION_ABORTED
+
+
+ The transaction was aborted.
+
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.session;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/aborttransaction.xml b/reference/mongodb/mongodb/driver/session/aborttransaction.xml
new file mode 100644
index 0000000000..fb76050378
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/aborttransaction.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::abortTransaction
+ トランザクションを中止する
+
+
+
+ &reftitle.description;
+
+ finalpublicvoidMongoDB\Driver\Session::abortTransaction
+
+
+
+ Terminates the multi-document transaction and rolls back any data changes
+ made by the operations within the transaction. That is, the transaction ends
+ without saving any of the changes made by the operations in the transaction.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\RuntimeException if the transaction could not be aborted (e.g. a transaction was not started).
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::startSession
+ MongoDB\Driver\Session::commitTransaction
+ MongoDB\Driver\Session::startTransaction
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/advanceclustertime.xml b/reference/mongodb/mongodb/driver/session/advanceclustertime.xml
new file mode 100644
index 0000000000..03a8a3007c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/advanceclustertime.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::advanceClusterTime
+ このセッションのクラスタ時刻を進める
+
+
+
+ &reftitle.description;
+
+ finalpublicvoidMongoDB\Driver\Session::advanceClusterTime
+ arrayobjectclusterTime
+
+
+ Advances the cluster time for this session. If the cluster time is less than
+ or equal to the session's current cluster time, this function is a no-op.
+
+
+ By using this method in conjunction with
+ MongoDB\Driver\Session::advanceOperationTime to copy
+ the cluster and operation times from another session, you can ensure that
+ operations in this session are causally consistent with the last operation in
+ the other session.
+
+
+
+
+ &reftitle.parameters;
+
+
+ clusterTime
+
+
+ The cluster time is a document containing a logical timestamp and server
+ signature. Typically, this value will be obtained by calling
+ MongoDB\Driver\Session::getClusterTime on another
+ session object.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Session::advanceOperationTime
+ MongoDB\Driver\Session::getClusterTime
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/advanceoperationtime.xml b/reference/mongodb/mongodb/driver/session/advanceoperationtime.xml
new file mode 100644
index 0000000000..86feca2915
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/advanceoperationtime.xml
@@ -0,0 +1,91 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::advanceOperationTime
+ このセッションの操作時刻を進める
+
+
+
+ &reftitle.description;
+
+ finalpublicvoidMongoDB\Driver\Session::advanceOperationTime
+ MongoDB\BSON\TimestampInterfaceoperationTime
+
+
+ Advances the operation time for this session. If the operation time is less
+ than or equal to the session's current operation time, this function is a
+ no-op.
+
+
+ By using this method in conjunction with
+ MongoDB\Driver\Session::advanceClusterTime to copy
+ the operation and cluster times from another session, you can ensure that
+ operations in this session are causally consistent with the last operation in
+ the other session.
+
+
+
+
+ &reftitle.parameters;
+
+
+ operationTime
+
+
+ The operation time is a logical timestamp. Typically, this value will be
+ obtained by calling
+ MongoDB\Driver\Session::getOperationTime on
+ another session object.
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Session::advanceClusterTime
+ MongoDB\Driver\Session::getClusterTime
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/committransaction.xml b/reference/mongodb/mongodb/driver/session/committransaction.xml
new file mode 100644
index 0000000000..297d301888
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/committransaction.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::commitTransaction
+ トランザクションをコミットする
+
+
+
+ &reftitle.description;
+
+ finalpublicvoidMongoDB\Driver\Session::commitTransaction
+
+
+
+ Saves the changes made by the operations in the multi-document transaction
+ and ends the transaction. Until the commit, none of the data changes made
+ from within the transaction are visible outside the transaction.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws
+ MongoDB\Driver\Exception\CommandException if the
+ server could not commit the transaction (e.g. due to conflicts, network
+ issues). In case the exception's
+ MongoDB\Driver\Exception\CommandException::getResultDocument
+ has a "errorLabels" element, and this array contains a
+ "TransientTransactionError" or
+ "UnknownTransactionCommitResult" value, it is safe to re-try
+ the whole transaction. In newer versions of the
+ extension,
+ MongoDB\Driver\Exception\RuntimeException::hasErrorLabel
+ should be used to test for this situation instead.
+ Throws
+ MongoDB\Driver\Exception\RuntimeException if the
+ transaction could not be commited (e.g. a transaction was not
+ started).
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::startSession
+ MongoDB\Driver\Session::abortTransaction
+ MongoDB\Driver\Session::startTransaction
+ MongoDB\Driver\Exception\RuntimeException::hasErrorLabel
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/construct.xml b/reference/mongodb/mongodb/driver/session/construct.xml
new file mode 100644
index 0000000000..06e734f798
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/construct.xml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::__construct
+ 新しい Session (not used) を作成する
+
+
+
+ &reftitle.description;
+
+ finalprivateMongoDB\Driver\Session::__construct
+
+
+
+ MongoDB\Driver\Session objects are returned by
+ MongoDB\Driver\Manager::startSession and cannot be
+ constructed directly.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::startSession
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/endsession.xml b/reference/mongodb/mongodb/driver/session/endsession.xml
new file mode 100644
index 0000000000..a16af8c64f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/endsession.xml
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::endSession
+ セッションを終了する
+
+
+
+ &reftitle.description;
+
+ finalpublicvoidMongoDB\Driver\Session::endSession
+
+
+
+ This method closes an existing session. If a transaction was associated
+ with this session, the transaction will be aborted. After calling this
+ method, applications should not invoke other methods on the session.
+
+
+
+ Sessions are also closed during garbage collection. It should not be
+ necessary to call this method under normal circumstances.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::startSession
+ MongoDB\Driver\Session::abortTransaction
+ MongoDB\Driver\Session::commitTransaction
+ MongoDB\Driver\Session::startTransaction
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/getclustertime.xml b/reference/mongodb/mongodb/driver/session/getclustertime.xml
new file mode 100644
index 0000000000..b6f7259078
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/getclustertime.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::getClusterTime
+ cluster time for this session を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectnullMongoDB\Driver\Session::getClusterTime
+
+
+
+ Returns the cluster time for this session. If the session has not been used
+ for any operation and
+ MongoDB\Driver\Session::advanceClusterTime has not
+ been called, the cluster time will be &null;.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the cluster time for this session, or &null; if the session has no
+ cluster time.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Session::advanceClusterTime
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/getlogicalsessionid.xml b/reference/mongodb/mongodb/driver/session/getlogicalsessionid.xml
new file mode 100644
index 0000000000..6550910657
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/getlogicalsessionid.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::getLogicalSessionId
+ logical session ID for this session を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectMongoDB\Driver\Session::getLogicalSessionId
+
+
+
+ Returns the logical session ID for this session, which may be used to
+ identify this session's operations on the server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the logical session ID for this session.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/getoperationtime.xml b/reference/mongodb/mongodb/driver/session/getoperationtime.xml
new file mode 100644
index 0000000000..0383a729ed
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/getoperationtime.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::getOperationTime
+ operation time for this session を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\BSON\TimestampnullMongoDB\Driver\Session::getOperationTime
+
+
+
+ Returns the operation time for this session. If the session has not been used
+ for any operation and
+ MongoDB\Driver\Session::advanceOperationTime has not
+ been called, the operation time will be &null;
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the operation time for this session, or &null; if the session has no
+ operation time.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Session::advanceOperationTime
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/getserver.xml b/reference/mongodb/mongodb/driver/session/getserver.xml
new file mode 100644
index 0000000000..f96a74b8a3
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/getserver.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::getServer
+ server to which this session is pinned を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServernullMongoDB\Driver\Session::getServer
+
+
+
+ Returns the MongoDB\Driver\Server to which this
+ session is pinned. If the session is not pinned to a server, &null; will be
+ returned.
+
+
+ Session pinning is primarily used for sharded transactions, as all commands
+ within a sharded transaction must be sent to the same mongos instance. This
+ method is intended to be used by libraries built atop the extension to allow
+ use of a pinned server instead of invoking server selection.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the MongoDB\Driver\Server to which this
+ session is pinned, or &null; if the session is not pinned to any server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/gettransactionoptions.xml b/reference/mongodb/mongodb/driver/session/gettransactionoptions.xml
new file mode 100644
index 0000000000..b43202fb6b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/gettransactionoptions.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::getTransactionOptions
+ 現在実行中のトランザクションのオプションを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarraynullMongoDB\Driver\Session::getTransactionOptions
+
+
+
+ Returns options for the currently running transaction.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a array containing current transaction options, or
+ &null; if no transaction is running.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Session::getTransactionState
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/gettransactionstate.xml b/reference/mongodb/mongodb/driver/session/gettransactionstate.xml
new file mode 100644
index 0000000000..797e669790
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/gettransactionstate.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::getTransactionState
+ current transaction state for this session を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\Session::getTransactionState
+
+
+
+ Returns the transaction state for this session.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the current transaction state for this session.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Session::isInTransaction
+ MongoDB\Driver\Session::getTransactionOptions
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/isdirty.xml b/reference/mongodb/mongodb/driver/session/isdirty.xml
new file mode 100644
index 0000000000..e7e4785cbc
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/isdirty.xml
@@ -0,0 +1,63 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::isDirty
+ the session has been marked as dirty かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Session::isDirty
+
+
+
+ Returns whether the session has been marked as dirty (i.e. it has been used
+ with a command that encountered a network error).
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns whether the session has been marked as dirty.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/isintransaction.xml b/reference/mongodb/mongodb/driver/session/isintransaction.xml
new file mode 100644
index 0000000000..e239a1fc18
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/isintransaction.xml
@@ -0,0 +1,72 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::isInTransaction
+ a multi-document transaction is in progress かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\Session::isInTransaction
+
+
+
+ Returns whether a multi-document transaction is currently in progress for
+ this session. A transaction is considered "in progress" if it has been
+ started but has not been committed or aborted.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if a transaction is currently in progress for this session,
+ and &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Session::getTransactionState
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/session/starttransaction.xml b/reference/mongodb/mongodb/driver/session/starttransaction.xml
new file mode 100644
index 0000000000..657015c411
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/session/starttransaction.xml
@@ -0,0 +1,146 @@
+
+
+
+
+
+
+ MongoDB\Driver\Session::startTransaction
+ トランザクションを開始する
+
+
+
+ &reftitle.description;
+
+ finalpublicvoidMongoDB\Driver\Session::startTransaction
+ arraynulloptions&null;
+
+
+ Starts a multi-document transaction associated with the session. At any given
+ time, you can have at most one open transaction for a session. After starting
+ a transaction, the session object must be passed to each operation via
+ the "session" option (e.g.
+ MongoDB\Driver\Manager::executeBulkWrite) in order
+ to associate that operation with the transaction.
+
+
+ Transactions can be committed through
+ MongoDB\Driver\Session::commitTransaction, and
+ aborted with
+ MongoDB\Driver\Session::abortTransaction.
+ Transactions are also automatically aborted when the session is closed from
+ garbage collection or by explicitly calling
+ MongoDB\Driver\Session::endSession.
+
+
+
+
+ &reftitle.parameters;
+
+
+ options
+
+
+ Options can be passed as argument to this method. Each element in this
+ options array overrides the corresponding option from the
+ "defaultTransactionOptions" option, if set when
+ starting the session with
+ MongoDB\Driver\Manager::startSession.
+
+
+
+
+
+
+
+
+
+
+ &reftitle.returnvalues;
+
+ &return.void;
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\CommandException if the transaction could not be started because of a server-side problem (e.g. a lock could not be obtained).
+ Throws MongoDB\Driver\Exception\RuntimeException if the transaction could not be started (e.g. a transaction was already started).
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.6.0
+
+
+ The "maxCommitTimeMS" option was added.
+
+
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::startSession
+ MongoDB\Driver\Session::commitTransaction
+ MongoDB\Driver\Session::abortTransaction
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/topologydescription.xml b/reference/mongodb/mongodb/driver/topologydescription.xml
new file mode 100644
index 0000000000..ca32f92a6f
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/topologydescription.xml
@@ -0,0 +1,161 @@
+
+
+
+
+
+
+ MongoDB\Driver\TopologyDescription クラス
+ MongoDB\Driver\TopologyDescription
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\TopologyDescription class is a
+ value object that represents a topology to which the driver is connected.
+ Instances of this class are returned by
+ MongoDB\Driver\Monitoring\TopologyChangedEvent
+ methods.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\TopologyDescription
+
+
+
+ final
+
+ MongoDB\Driver\TopologyDescription
+
+
+
+ &Constants;
+
+ const
+ string
+ MongoDB\Driver\TopologyDescription::TYPE_UNKNOWN
+ "Unknown"
+
+
+ const
+ string
+ MongoDB\Driver\TopologyDescription::TYPE_SINGLE
+ "Single"
+
+
+ const
+ string
+ MongoDB\Driver\TopologyDescription::TYPE_SHARDED
+ "Sharded"
+
+
+ const
+ string
+ MongoDB\Driver\TopologyDescription::TYPE_REPLICA_SET_NO_PRIMARY
+ "ReplicaSetNoPrimary"
+
+
+ const
+ string
+ MongoDB\Driver\TopologyDescription::TYPE_REPLICA_SET_WITH_PRIMARY
+ "ReplicaSetWithPrimary"
+
+
+ const
+ string
+ MongoDB\Driver\TopologyDescription::TYPE_LOAD_BALANCED
+ "LoadBalanced"
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+
+ MongoDB\Driver\TopologyDescription::TYPE_UNKNOWN
+
+ Unknown topology type, returned by MongoDB\Driver\TopologyDescription::getType.
+
+
+
+
+ MongoDB\Driver\TopologyDescription::TYPE_SINGLE
+
+ Single server (i.e. direct connection), returned by MongoDB\Driver\TopologyDescription::getType.
+
+
+
+
+ MongoDB\Driver\TopologyDescription::TYPE_SHARDED
+
+ Sharded cluster, returned by MongoDB\Driver\TopologyDescription::getType.
+
+
+
+
+ MongoDB\Driver\TopologyDescription::TYPE_REPLICA_SET_NO_PRIMARY
+
+ Replica set with no primary server, returned by MongoDB\Driver\TopologyDescription::getType.
+
+
+
+
+ MongoDB\Driver\TopologyDescription::TYPE_REPLICA_SET_WITH_PRIMARY
+
+ Replica set with a primary server, returned by MongoDB\Driver\TopologyDescription::getType.
+
+
+
+
+ MongoDB\Driver\TopologyDescription::TYPE_LOAD_BALANCED
+
+ Load balanced topology, returned by MongoDB\Driver\TopologyDescription::getType.
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.topologydescription;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/topologydescription/getservers.xml b/reference/mongodb/mongodb/driver/topologydescription/getservers.xml
new file mode 100644
index 0000000000..05299aa771
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/topologydescription/getservers.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+ MongoDB\Driver\TopologyDescription::getServers
+ servers in the topology を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\TopologyDescription::getServers
+
+
+
+ Returns an array of MongoDB\Driver\ServerDescription
+ objects corresponding to the known servers in the topology.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array of MongoDB\Driver\ServerDescription
+ objects corresponding to the known servers in the topology.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/topologydescription/gettype.xml b/reference/mongodb/mongodb/driver/topologydescription/gettype.xml
new file mode 100644
index 0000000000..80d0123445
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/topologydescription/gettype.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+ MongoDB\Driver\TopologyDescription::getType
+ string denoting the type of this topology を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\TopologyDescription::getType
+
+
+
+ Returns a string denoting the type of this topology. The value
+ will correlate with a
+ MongoDB\Driver\TopologyDescription constant.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a string denoting the type of this topology.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/topologydescription/hasreadableserver.xml b/reference/mongodb/mongodb/driver/topologydescription/hasreadableserver.xml
new file mode 100644
index 0000000000..b30a16262a
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/topologydescription/hasreadableserver.xml
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+ MongoDB\Driver\TopologyDescription::hasReadableServer
+ the topology has a readable server かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\TopologyDescription::hasReadableServer
+ MongoDB\Driver\ReadPreferencenullreadPreference&null;
+
+
+ Returns whether the topology has a readable server or, if
+ readPreference is specified, a server matching the
+ specified read preference.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns whether the topology has a readable server or, if
+ readPreference is specified, a server matching the
+ specified read preference.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/topologydescription/haswritableserver.xml b/reference/mongodb/mongodb/driver/topologydescription/haswritableserver.xml
new file mode 100644
index 0000000000..5ffa22b4a2
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/topologydescription/haswritableserver.xml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+ MongoDB\Driver\TopologyDescription::hasWritableServer
+ the topology has a writable server かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\TopologyDescription::hasWritableServer
+
+
+
+ Returns whether the topology has a writable server.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns whether the topology has a writable server.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcern.xml b/reference/mongodb/mongodb/driver/writeconcern.xml
new file mode 100644
index 0000000000..e3cd17f79e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcern.xml
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcern クラス
+ MongoDB\Driver\WriteConcern
+
+
+
+
+
+ &reftitle.intro;
+
+ MongoDB\Driver\WriteConcern describes the level of
+ acknowledgement requested from MongoDB for write operations to a standalone
+ mongod or to replica sets or to sharded clusters. In
+ sharded clusters, mongos instances will pass the write
+ concern on to the shards.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\WriteConcern
+
+
+
+ final
+
+ MongoDB\Driver\WriteConcern
+
+
+
+ MongoDB\BSON\Serializable
+
+
+
+ Serializable
+
+
+
+ &Constants;
+
+ const
+ string
+ MongoDB\Driver\WriteConcern::MAJORITY
+ "majority"
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reftitle.constants;
+
+
+
+ MongoDB\Driver\WriteConcern::MAJORITY
+
+
+ Majority of all the members in the set; arbiters, non-voting members,
+ passive members, hidden members and delayed members are all included in
+ the definition of majority write concern.
+
+
+
+
+
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.7.0
+
+ Serializable を実装しました。
+
+
+
+ PECL mongodb 1.2.0
+
+ MongoDB\BSON\Serializable を実装しました。
+
+
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.writeconcern;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcern/bsonserialize.xml b/reference/mongodb/mongodb/driver/writeconcern/bsonserialize.xml
new file mode 100644
index 0000000000..bbb3b30617
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcern/bsonserialize.xml
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcern::bsonSerialize
+ object for BSON serialization を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstdClassMongoDB\Driver\WriteConcern::bsonSerialize
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an object for serializing the WriteConcern as BSON.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteConcern::bsonSerialize with majority write concern
+
+bsonSerialize());
+
+echo "\n", MongoDB\BSON\Document::fromPHP($wc)->toRelaxedExtendedJSON();
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(8) "majority"
+}
+
+{ "w" : "majority" }
+]]>
+
+
+ MongoDB\Driver\WriteConcern::bsonSerialize with wtimeout and journal
+
+bsonSerialize());
+
+echo "\n", MongoDB\BSON\Document::fromPHP($wc)->toRelaxedExtendedJSON();
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ int(2)
+ ["j"]=>
+ bool(true)
+ ["wtimeout"]=>
+ int(1000)
+}
+
+{ "w" : 2, "j" : true, "wtimeout" : 1000 }
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\BSON\Serializable::bsonSerialize
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcern/construct.xml b/reference/mongodb/mongodb/driver/writeconcern/construct.xml
new file mode 100644
index 0000000000..e185592eb7
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcern/construct.xml
@@ -0,0 +1,232 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcern::__construct
+ 新しい WriteConcern を作成する
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\WriteConcern::__construct
+ stringintw
+ intnullwtimeout&null;
+ boolnulljournal&null;
+
+
+ Constructs a new MongoDB\Driver\WriteConcern, which is
+ an immutable value object.
+
+
+
+
+ &reftitle.parameters;
+
+
+ w
+
+
+
+ Write concern
+
+
+
+ Value
+ Description
+
+
+
+
+ 1
+
+ Requests acknowledgement that the write operation has propagated to
+ the standalone mongod or the primary in a replica
+ set. This is the default write concern for MongoDB.
+
+
+
+ 0
+
+ Requests no acknowledgment of the write operation. However, this may
+ return information about socket exceptions and networking errors to
+ the application.
+
+
+
+ <integer greater than 1>
+
+ Numbers greater than 1 are valid only for replica sets to request
+ acknowledgement from specified number of members, including the
+ primary.
+
+
+
+ MongoDB\Driver\WriteConcern::MAJORITY
+
+
+ Requests acknowledgment that write operations have propagated to the
+ majority of voting nodes, including the primary, and have been
+ written to the on-disk journal for these nodes.
+
+
+ Prior to MongoDB 3.0, this refers to the majority of replica set
+ members (not just voting nodes).
+
+
+
+
+ string
+
+ A string value is interpereted as a tag set. Requests acknowledgement
+ that the write operations have propagated to a replica set member
+ with the specified tag.
+
+
+
+
+
+
+
+
+
+ wtimeout
+
+
+ How long to wait (in milliseconds) for secondaries before failing.
+
+
+ wtimeout causes write operations to return with an
+ error (WriteConcernError) after the specified
+ limit, even if the required write concern will eventually succeed. When
+ these write operations return, MongoDB does not undo successful data
+ modifications performed before the write concern exceeded the
+ wtimeout time limit.
+
+
+ If specified, wtimeout must be a signed 64-bit integer
+ greater than or equal to zero.
+
+
+
+ Write concern timeout
+
+
+
+ Value
+ Description
+
+
+
+
+ 0
+ Block indefinitely. This is the default.
+
+
+ <integer greater than 0>
+
+ Milliseconds to wait until returning.
+
+
+
+
+
+
+
+
+
+ journal
+
+
+ Wait until mongod has applied the write to the journal.
+
+
+
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+ Throws MongoDB\Driver\Exception\InvalidArgumentException if w is invalid or wtimeout is either negative or greater than the bounds of a signed 32-bit integer.
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.7.0
+
+ The wTimeout parameter now accepts 64-bit values.
+
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteConcern::__construct の例
+
+
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcern/getjournal.xml b/reference/mongodb/mongodb/driver/writeconcern/getjournal.xml
new file mode 100644
index 0000000000..f49509273c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcern/getjournal.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcern::getJournal
+ WriteConcern の "journal" option を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolnullMongoDB\Driver\WriteConcern::getJournal
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the WriteConcern's "journal" option.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteConcern::getJournal の例
+
+getJournal());
+
+$wc = new MongoDB\Driver\WriteConcern(1, 0, true);
+var_dump($wc->getJournal());
+
+$wc = new MongoDB\Driver\WriteConcern(1, 0, false);
+var_dump($wc->getJournal());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcern/getw.xml b/reference/mongodb/mongodb/driver/writeconcern/getw.xml
new file mode 100644
index 0000000000..d86ef35afe
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcern/getw.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcern::getW
+ WriteConcern の "w" option を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringintnullMongoDB\Driver\WriteConcern::getW
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the WriteConcern's "w" option.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteConcern::getW の例
+
+getW());
+
+$wc = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY);
+var_dump($wc->getW());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcern/getwtimeout.xml b/reference/mongodb/mongodb/driver/writeconcern/getwtimeout.xml
new file mode 100644
index 0000000000..05b346e37e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcern/getwtimeout.xml
@@ -0,0 +1,121 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcern::getWtimeout
+ WriteConcern の "wtimeout" option を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\WriteConcern::getWtimeout
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the WriteConcern's "wtimeout" option.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+
+ PECL mongodb 1.7.0
+
+ On 32-bit systems, this method will always truncate the wTimeout
+ value if it exceeds the 32-bit range. In that case, a warning will be
+ emitted.
+
+
+
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteConcern::getWtimeout の例
+
+getWtimeout());
+
+$wc = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 3000);
+var_dump($wc->getWtimeout());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcern/isdefault.xml b/reference/mongodb/mongodb/driver/writeconcern/isdefault.xml
new file mode 100644
index 0000000000..b0dddeac9d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcern/isdefault.xml
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcern::isDefault
+ this is the default write concern かどうかを調べる
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\WriteConcern::isDefault
+
+
+
+ Returns whether this is the default write concern (i.e. no options are
+ specified). This method is primarily intended to be used in conjunction with
+ MongoDB\Driver\Manager::getWriteConcern to determine
+ whether the Manager has been constructed without any write concern options.
+
+
+ The driver will not include a default write concern in its write operations
+ (e.g. MongoDB\Driver\Manager::executeBulkWrite) in
+ order to allow the server to apply its own default, which may have been
+ modified.
+ Libraries that access the Manager's write concern to include it in their own
+ write commands should use this method to ensure that default write concerns
+ are left unset.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if this is the default write concern and &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteConcern::isDefault の例
+
+isDefault());
+
+$manager = new MongoDB\Driver\Manager('mongodb://127.0.0.1/?w=majority');
+$wc = $manager->getWriteConcern();
+var_dump($wc->isDefault());
+
+$manager = new MongoDB\Driver\Manager('mongodb://127.0.0.1/');
+$wc = $manager->getWriteConcern();
+var_dump($wc->isDefault());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Manager::getWriteConcern
+ Modify Default Write Concern in the MongoDB manual
+ Write Concern reference
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcernerror.xml b/reference/mongodb/mongodb/driver/writeconcernerror.xml
new file mode 100644
index 0000000000..39d5de287b
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcernerror.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcernError クラス
+ MongoDB\Driver\WriteConcernError
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\WriteConcernError class
+ encapsulates information about a write concern error and may be returned by
+ MongoDB\Driver\WriteResult::getWriteConcernError.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\WriteConcernError
+
+
+
+ final
+
+ MongoDB\Driver\WriteConcernError
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.writeconcernerror;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcernerror/getcode.xml b/reference/mongodb/mongodb/driver/writeconcernerror/getcode.xml
new file mode 100644
index 0000000000..f8bb0fdf48
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcernerror/getcode.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcernError::getCode
+ WriteConcernError の error code を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\WriteConcernError::getCode
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the WriteConcernError's error code.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteConcernError::getCode の例
+
+insert(['x' => 1]);
+
+$writeConcern = new MongoDB\Driver\WriteConcern(2, 1);
+
+try {
+ $manager->executeBulkWrite('db.collection', $bulk, ['writeConcern' => $writeConcern]);
+} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
+ var_dump($e->getWriteResult()->getWriteConcernError()->getCode());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcernerror/getinfo.xml b/reference/mongodb/mongodb/driver/writeconcernerror/getinfo.xml
new file mode 100644
index 0000000000..63f37eb65e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcernerror/getinfo.xml
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcernError::getInfo
+ WriteConcernError のメタデータドキュメントを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectnullMongoDB\Driver\WriteConcernError::getInfo
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the metadata document for the WriteConcernError, or &null; if
+ no metadata is available.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteConcernError::getInfo の例
+
+insert(['x' => 1]);
+
+$writeConcern = new MongoDB\Driver\WriteConcern(2, 1);
+
+try {
+ $manager->executeBulkWrite('db.collection', $bulk, ['writeConcern' => $writeConcern]);
+} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
+ var_dump($e->getWriteResult()->getWriteConcernError()->getInfo());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ bool(true)
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeconcernerror/getmessage.xml b/reference/mongodb/mongodb/driver/writeconcernerror/getmessage.xml
new file mode 100644
index 0000000000..9bb4a8e957
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeconcernerror/getmessage.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteConcernError::getMessage
+ WriteConcernError の error message を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\WriteConcernError::getMessage
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the WriteConcernError's error message.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteConcernError::getMessage の例
+
+insert(['x' => 1]);
+
+$writeConcern = new MongoDB\Driver\WriteConcern(2, 1);
+
+try {
+ $manager->executeBulkWrite('db.collection', $bulk, ['writeConcern' => $writeConcern]);
+} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
+ var_dump($e->getWriteResult()->getWriteConcernError()->getMessage());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeerror.xml b/reference/mongodb/mongodb/driver/writeerror.xml
new file mode 100644
index 0000000000..f7d460b71c
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeerror.xml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteError クラス
+ MongoDB\Driver\WriteError
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\WriteError class encapsulates
+ information about a write error and may be returned as an array element from
+ MongoDB\Driver\WriteResult::getWriteErrors.
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\WriteError
+
+
+
+ final
+
+ MongoDB\Driver\WriteError
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.writeerror;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeerror/getcode.xml b/reference/mongodb/mongodb/driver/writeerror/getcode.xml
new file mode 100644
index 0000000000..6879a98808
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeerror/getcode.xml
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteError::getCode
+ WriteError の error code を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\WriteError::getCode
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the WriteError's error code.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteError::getCode の例
+
+insert(['_id' => 1]);
+$bulk->insert(['_id' => 1]);
+
+try {
+ $manager->executeBulkWrite('db.collection', $bulk);
+} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
+ var_dump($e->getWriteResult()->getWriteErrors()[0]->getCode());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeerror/getindex.xml b/reference/mongodb/mongodb/driver/writeerror/getindex.xml
new file mode 100644
index 0000000000..3c93f82dce
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeerror/getindex.xml
@@ -0,0 +1,106 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteError::getIndex
+ index of the write operation corresponding to this WriteError を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\WriteError::getIndex
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the index of the write operation (from
+ MongoDB\Driver\BulkWrite) corresponding to this
+ WriteError.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteError::getIndex の例
+
+insert(['_id' => 1]);
+$bulk->insert(['_id' => 1]);
+
+try {
+ $manager->executeBulkWrite('db.collection', $bulk);
+} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
+ var_dump($e->getWriteResult()->getWriteErrors()[0]->getIndex());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\BulkWrite
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeerror/getinfo.xml b/reference/mongodb/mongodb/driver/writeerror/getinfo.xml
new file mode 100644
index 0000000000..7d31b9e998
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeerror/getinfo.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteError::getInfo
+ WriteError のメタデータドキュメントを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicobjectnullMongoDB\Driver\WriteError::getInfo
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the metadata document for the WriteError, or &null; if no metadata is
+ available.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeerror/getmessage.xml b/reference/mongodb/mongodb/driver/writeerror/getmessage.xml
new file mode 100644
index 0000000000..73dacdc91a
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeerror/getmessage.xml
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteError::getMessage
+ WriteError の error message を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicstringMongoDB\Driver\WriteError::getMessage
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the WriteError's error message.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteError::getMessage の例
+
+insert(['_id' => 1]);
+$bulk->insert(['_id' => 1]);
+
+try {
+ $manager->executeBulkWrite('db.collection', $bulk);
+} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
+ var_dump($e->getWriteResult()->getWriteErrors()[0]->getMessage());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult.xml b/reference/mongodb/mongodb/driver/writeresult.xml
new file mode 100644
index 0000000000..3c2815c2d4
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult.xml
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult クラス
+ MongoDB\Driver\WriteResult
+
+
+
+
+
+ &reftitle.intro;
+
+ The MongoDB\Driver\WriteResult class encapsulates
+ information about an executed
+ MongoDB\Driver\BulkWrite and may be returned by
+ MongoDB\Driver\Manager::executeBulkWrite.
+
+
+
+
+
+
+ &reftitle.classsynopsis;
+
+
+
+ MongoDB\Driver\WriteResult
+
+
+
+ final
+
+ MongoDB\Driver\WriteResult
+
+
+
+
+ &Methods;
+
+
+
+
+
+
+
+
+ &reference.mongodb.mongodb.driver.entities.writeresult;
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/getdeletedcount.xml b/reference/mongodb/mongodb/driver/writeresult/getdeletedcount.xml
new file mode 100644
index 0000000000..565c271401
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/getdeletedcount.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::getDeletedCount
+ number of documents deleted を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\WriteResult::getDeletedCount
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the number of documents deleted.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.unacknowledged;
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.throw-unacknowledged-write;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::getDeletedCount の例
+
+insert(['x' => 1]);
+$bulk->update(['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->update(['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->update(['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->delete(['x' => 1]);
+
+$result = $manager->executeBulkWrite('db.collection', $bulk);
+
+var_dump($result->getDeletedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/getinsertedcount.xml b/reference/mongodb/mongodb/driver/writeresult/getinsertedcount.xml
new file mode 100644
index 0000000000..8d1122e8a0
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/getinsertedcount.xml
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::getInsertedCount
+ number of documents inserted (excluding upserts) を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\WriteResult::getInsertedCount
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the number of documents inserted (excluding upserts).
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.unacknowledged;
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.throw-unacknowledged-write;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::getInsertedCount の例
+
+insert(['x' => 1]);
+$bulk->update(['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->update(['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->update(['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->delete(['x' => 1]);
+
+$result = $manager->executeBulkWrite('db.collection', $bulk);
+
+var_dump($result->getInsertedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/getmatchedcount.xml b/reference/mongodb/mongodb/driver/writeresult/getmatchedcount.xml
new file mode 100644
index 0000000000..3a2bb28fe7
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/getmatchedcount.xml
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::getMatchedCount
+ number of documents selected for update を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\WriteResult::getMatchedCount
+
+
+
+ If the update operation results in no change to the document (e.g. setting
+ the value of a field to its current value), the matched count may be greater
+ than the value returned by
+ MongoDB\Driver\WriteResult::getModifiedCount.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the number of documents selected for update.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.unacknowledged;
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.throw-unacknowledged-write;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::getMatchedCount の例
+
+insert(['x' => 1]);
+$bulk->update(['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->update(['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->update(['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->delete(['x' => 1]);
+
+$result = $manager->executeBulkWrite('db.collection', $bulk);
+
+var_dump($result->getMatchedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteResult::getModifiedCount
+ MongoDB\Driver\WriteResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/getmodifiedcount.xml b/reference/mongodb/mongodb/driver/writeresult/getmodifiedcount.xml
new file mode 100644
index 0000000000..3ddd4fded6
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/getmodifiedcount.xml
@@ -0,0 +1,127 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::getModifiedCount
+ number of existing documents updated を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\WriteResult::getModifiedCount
+
+
+
+ If the update operation results in no change to the document (e.g. setting
+ the value of a field to its current value), the modified count may be less
+ than the value returned by
+ MongoDB\Driver\WriteResult::getMatchedCount.
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the number of existing documents updated.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.unacknowledged;
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.throw-unacknowledged-write;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::getModifiedCount の例
+
+insert(['x' => 1]);
+$bulk->update(['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->update(['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->update(['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->delete(['x' => 1]);
+
+$result = $manager->executeBulkWrite('db.collection', $bulk);
+
+var_dump($result->getModifiedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteResult::getMatchedCount
+ MongoDB\Driver\WriteResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/getserver.xml b/reference/mongodb/mongodb/driver/writeresult/getserver.xml
new file mode 100644
index 0000000000..15c23f7416
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/getserver.xml
@@ -0,0 +1,105 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::getServer
+ server associated with this write result を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\ServerMongoDB\Driver\WriteResult::getServer
+
+
+
+ Returns the MongoDB\Driver\Server associated with this
+ write result. This is the server that executed the
+ MongoDB\Driver\BulkWrite.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the MongoDB\Driver\Server associated with this
+ write result.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::getServer の例
+
+selectServer();
+
+$bulk = new MongoDB\Driver\BulkWrite;
+$bulk->insert(['x' => 1]);
+
+$result = $server->executeBulkWrite('db.collection', $bulk);
+
+var_dump($result->getServer() == $server);
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\Server
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/getupsertedcount.xml b/reference/mongodb/mongodb/driver/writeresult/getupsertedcount.xml
new file mode 100644
index 0000000000..dc21254478
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/getupsertedcount.xml
@@ -0,0 +1,125 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::getUpsertedCount
+ number of documents inserted by an upsert を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicintMongoDB\Driver\WriteResult::getUpsertedCount
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns the number of documents inserted by an upsert.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.unacknowledged;
+ &mongodb.throws.argumentparsing;
+
+
+
+
+ &reftitle.changelog;
+
+
+
+
+
+ &Version;
+ &Description;
+
+
+
+ &mongodb.changelog.throw-unacknowledged-write;
+
+
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::getUpsertedCount の例
+
+insert(['x' => 1]);
+$bulk->update(['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->update(['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->update(['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->delete(['x' => 1]);
+
+$result = $manager->executeBulkWrite('db.collection', $bulk);
+
+var_dump($result->getUpsertedCount());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteResult::getUpsertedIds
+ MongoDB\Driver\WriteResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/getupsertedids.xml b/reference/mongodb/mongodb/driver/writeresult/getupsertedids.xml
new file mode 100644
index 0000000000..51af82943e
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/getupsertedids.xml
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::getUpsertedIds
+ array of identifiers for upserted documents を返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\WriteResult::getUpsertedIds
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array of identifiers (i.e. "_id" field values)
+ for upserted documents. The array keys will correspond to the index of the
+ write operation (from MongoDB\Driver\BulkWrite)
+ responsible for the upsert.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::getUpsertedIds の例
+
+insert(['x' => 1]);
+$bulk->update(['x' => 1], ['$set' => ['y' => 3]]);
+$bulk->update(['x' => 2], ['$set' => ['y' => 1]], ['upsert' => true]);
+$bulk->update(['x' => 3], ['$set' => ['y' => 2]], ['upsert' => true]);
+$bulk->delete(['x' => 1]);
+
+$result = $manager->executeBulkWrite('db.collection', $bulk);
+
+var_dump($result->getUpsertedIds());
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\BSON\ObjectId)#4 (1) {
+ ["oid"]=>
+ string(24) "580e62a224f2302f191b880b"
+ }
+ [3]=>
+ object(MongoDB\BSON\ObjectId)#5 (1) {
+ ["oid"]=>
+ string(24) "580e62a224f2302f191b880c"
+ }
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteResult::getUpsertedCount
+ MongoDB\Driver\WriteResult::isAcknowledged
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/getwriteconcernerror.xml b/reference/mongodb/mongodb/driver/writeresult/getwriteconcernerror.xml
new file mode 100644
index 0000000000..b4de660977
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/getwriteconcernerror.xml
@@ -0,0 +1,118 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::getWriteConcernError
+ 発生した書き込み懸念エラーを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicMongoDB\Driver\WriteConcernErrornullMongoDB\Driver\WriteResult::getWriteConcernError
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns a MongoDB\Driver\WriteConcernError if a write
+ concern error was encountered during the write operation, and &null;
+ otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::getWriteConcernError の例
+
+insert(['x' => 1]);
+
+$writeConcern = new MongoDB\Driver\WriteConcern(2, 1);
+
+try {
+ $manager->executeBulkWrite('db.collection', $bulk, ['writeConcern' => $writeConcern]);
+} catch(MongoDB\Driver\Exception\BulkWriteException $e) {
+ var_dump($e->getWriteResult()->getWriteConcernError());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ string(33) "waiting for replication timed out"
+ ["code"]=>
+ int(64)
+ ["info"]=>
+ object(stdClass)#7 (1) {
+ ["wtimeout"]=>
+ bool(true)
+ }
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteConcern
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/getwriteerrors.xml b/reference/mongodb/mongodb/driver/writeresult/getwriteerrors.xml
new file mode 100644
index 0000000000..b49014345d
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/getwriteerrors.xml
@@ -0,0 +1,183 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::getWriteErrors
+ 発生した書き込みエラーを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicarrayMongoDB\Driver\WriteResult::getWriteErrors
+
+
+
+
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns an array of MongoDB\Driver\WriteError objects
+ for any write errors encountered during the write operation. The array will
+ be empty if no write errors occurred.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::getWriteErrors with a single error
+
+insert(['_id' => 1]);
+$bulk->insert(['_id' => 2]);
+$bulk->insert(['_id' => 2]);
+$bulk->insert(['_id' => 3]);
+$bulk->insert(['_id' => 4]);
+$bulk->insert(['_id' => 4]);
+
+try {
+ $result = $manager->executeBulkWrite('db.collection', $bulk);
+} catch (MongoDB\Driver\Exception\BulkWriteException $e) {
+ var_dump($e->getWriteResult()->getWriteErrors());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\Driver\WriteError)#5 (4) {
+ ["message"]=>
+ string(81) "E11000 duplicate key error collection: db.collection index: _id_ dup key: { : 2 }"
+ ["code"]=>
+ int(11000)
+ ["index"]=>
+ int(2)
+ ["info"]=>
+ NULL
+ }
+}
+]]>
+
+
+
+ MongoDB\Driver\WriteResult::getWriteErrors with multiple errors
+
+ false]);
+$bulk->insert(['_id' => 1]);
+$bulk->insert(['_id' => 2]);
+$bulk->insert(['_id' => 2]);
+$bulk->insert(['_id' => 3]);
+$bulk->insert(['_id' => 4]);
+$bulk->insert(['_id' => 4]);
+
+try {
+ $result = $manager->executeBulkWrite('db.collection', $bulk);
+} catch (MongoDB\Driver\Exception\BulkWriteException $e) {
+ var_dump($e->getWriteResult()->getWriteErrors());
+}
+
+?>
+]]>
+
+ &example.outputs.similar;
+
+
+ object(MongoDB\Driver\WriteError)#5 (4) {
+ ["message"]=>
+ string(81) "E11000 duplicate key error collection: db.collection index: _id_ dup key: { : 2 }"
+ ["code"]=>
+ int(11000)
+ ["index"]=>
+ int(2)
+ ["info"]=>
+ NULL
+ }
+ [1]=>
+ object(MongoDB\Driver\WriteError)#6 (4) {
+ ["message"]=>
+ string(81) "E11000 duplicate key error collection: db.collection index: _id_ dup key: { : 4 }"
+ ["code"]=>
+ int(11000)
+ ["index"]=>
+ int(5)
+ ["info"]=>
+ NULL
+ }
+}
+]]>
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteError
+
+
+
+
+
+
diff --git a/reference/mongodb/mongodb/driver/writeresult/isacknowledged.xml b/reference/mongodb/mongodb/driver/writeresult/isacknowledged.xml
new file mode 100644
index 0000000000..a6698c7c37
--- /dev/null
+++ b/reference/mongodb/mongodb/driver/writeresult/isacknowledged.xml
@@ -0,0 +1,130 @@
+
+
+
+
+
+
+ MongoDB\Driver\WriteResult::isAcknowledged
+ the write was acknowledged かどうかを返す
+
+
+
+ &reftitle.description;
+
+ finalpublicboolMongoDB\Driver\WriteResult::isAcknowledged
+
+
+
+ If the write is acknowledged, other count fields will be available on the
+ MongoDB\Driver\WriteResult object.
+
+
+
+
+
+ &reftitle.parameters;
+ &no.function.parameters;
+
+
+
+ &reftitle.returnvalues;
+
+ Returns &true; if the write was acknowledged, and &false; otherwise.
+
+
+
+
+ &reftitle.errors;
+
+ &mongodb.throws.argumentparsing;
+
+
+
+
+
+ &reftitle.examples;
+
+ MongoDB\Driver\WriteResult::isAcknowledged with acknowledged write concern
+
+insert(['x' => 1]);
+
+$result = $manager->executeBulkWrite('db.collection', $bulk);
+
+var_dump($result->isAcknowledged());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+ MongoDB\Driver\WriteResult::isAcknowledged with unacknowledged write concern
+
+insert(['x' => 1]);
+
+$writeConcern = new MongoDB\Driver\WriteConcern(0);
+
+$result = $manager->executeBulkWrite('db.collection', $bulk, ['writeConcern' => $writeConcern]);
+
+var_dump($result->isAcknowledged());
+
+?>
+]]>
+
+ &example.outputs;
+
+
+
+
+
+
+
+
+ &reftitle.seealso;
+
+ MongoDB\Driver\WriteConcern
+ Write Concern reference
+
+
+
+
+
+
diff --git a/reference/mongodb/monitoring.xml b/reference/mongodb/monitoring.xml
new file mode 100644
index 0000000000..0fc8af464d
--- /dev/null
+++ b/reference/mongodb/monitoring.xml
@@ -0,0 +1,32 @@
+
+
+
+
+
+ モニタリングクラスとサブスクライバー関数
+ MongoDB\Driver\Monitoring
+
+
+ &Functions;
+ &reference.mongodb.functions.driver.entities.monitoring;
+
+
+ &reference.mongodb.mongodb.driver.monitoring.commandfailedevent;
+ &reference.mongodb.mongodb.driver.monitoring.commandstartedevent;
+ &reference.mongodb.mongodb.driver.monitoring.commandsucceededevent;
+
+ &reference.mongodb.mongodb.driver.monitoring.serverchangedevent;
+ &reference.mongodb.mongodb.driver.monitoring.serverclosedevent;
+ &reference.mongodb.mongodb.driver.monitoring.serveropeningevent;
+ &reference.mongodb.mongodb.driver.monitoring.serverheartbeatfailedevent;
+ &reference.mongodb.mongodb.driver.monitoring.serverheartbeatstartedevent;
+ &reference.mongodb.mongodb.driver.monitoring.serverheartbeatsucceededevent;
+ &reference.mongodb.mongodb.driver.monitoring.topologychangedevent;
+ &reference.mongodb.mongodb.driver.monitoring.topologyclosedevent;
+ &reference.mongodb.mongodb.driver.monitoring.topologyopeningevent;
+
+ &reference.mongodb.mongodb.driver.monitoring.commandsubscriber;
+ &reference.mongodb.mongodb.driver.monitoring.logsubscriber;
+ &reference.mongodb.mongodb.driver.monitoring.sdamsubscriber;
+ &reference.mongodb.mongodb.driver.monitoring.subscriber;
+
diff --git a/reference/mongodb/security.xml b/reference/mongodb/security.xml
new file mode 100644
index 0000000000..5a57d59ca3
--- /dev/null
+++ b/reference/mongodb/security.xml
@@ -0,0 +1,183 @@
+
+
+
+
+
+ セキュリティ
+
+
+ Request Injection Attacks
+
+ If you are passing $_GET (or $_POST)
+ parameters to your queries, make sure that they are cast to strings first.
+ Users can insert associative arrays in GET and POST requests, which could
+ then become unwanted $-queries.
+
+
+
+ A fairly innocuous example: suppose you are looking up a user's information
+ with the request http://www.example.com?username=bob.
+ Your application creates the query
+ $q = new \MongoDB\Driver\Query( [ 'username' => $_GET['username'] ]).
+
+
+
+ Someone could subvert this by getting
+ http://www.example.com?username[$ne]=foo, which PHP
+ will magically turn into an associative array, turning your query into
+ $q = new \MongoDB\Driver\Query( [ 'username' => [ '$ne' => 'foo' ] ] ),
+ which will return all users not named "foo" (all of your users, probably).
+
+
+
+ This is a fairly easy attack to defend against: make sure $_GET and $_POST
+ parameters are the type you expect before you send them to the database.
+ PHP has the filter_var function to assist with this.
+
+
+
+ Note that this type of attack can be used with any database interaction that
+ locates a document, including updates, upserts, deletes, and findAndModify
+ commands.
+
+
+
+ See the main documentation
+ for more information about SQL-injection-like issues with MongoDB.
+
+
+
+
+ Script Injection Attacks
+
+ If you are using JavaScript, make sure that any variables that cross the PHP-
+ to-JavaScript boundry are passed in the scope field of
+ MongoDB\BSON\Javascript, not interpolated into the
+ JavaScript string. This can come up when using $where
+ clauses in queries, mapReduce and group commands, and any other time you may
+ pass JavaScript into the database.
+
+
+ For example, suppose we have some JavaScript to greet a user in the database
+ logs. We could do:
+
+
+ "print('Hello, $username!');"
+] );
+
+$r = $m->executeCommand( 'dramio', $cmd );
+?>
+]]>
+
+
+ However, what if a malicious user passes in some JavaScript?
+
+
+ "print('Hello, $username!');"
+] );
+
+$r = $m->executeCommand( 'dramio', $cmd );
+?>
+]]>
+
+
+ Now MongoDB executes the JavaScript string
+ "print('Hello, '); db.users.drop(); print('!');".
+ This attack is easy to avoid: use args to pass
+ variables from PHP to JavaScript:
+
+
+ "function greet(username) { print('Hello, ' + username + '!'); }",
+ 'args' => $args,
+] );
+
+$r = $m->executeCommand( 'dramio', $cmd );
+?>
+]]>
+
+
+ This adds an argument to the JavaScript scope, which gets used as argument
+ for the greet function. Now if
+ someone tries to send malicious code, MongoDB will harmlessly print
+ Hello, '); db.dropDatabase(); print('!.
+
+
+
+ Using arguments helps to prevent malicious input from being executed by the
+ database. However, you must make sure that your code does not turn around
+ and execute the input anyway! It is best to avoid executing
+ any JavaScript on the server in the first place.
+
+
+
+ You are strongly recommended to stay clear of the $where
+ clause with queries, as it impacts performance significantly. Where
+ possible, use either normal query operators, or the Aggregation
+ Framework.
+
+
+
+ As alternative to MapReduce, which uses
+ JavaScript, consider using the Aggregation
+ Framework. Unlike Map/Reduce, it uses an idiomatic language to
+ construct queries, without having to write, and use, the slower JavaScript
+ approach that Map/Reduce requires.
+
+
+
+ The eval command
+ has been deprecated since MongoDB 3.0, and should also be avoided.
+
+
+
+
+
diff --git a/reference/mongodb/setup.xml b/reference/mongodb/setup.xml
new file mode 100644
index 0000000000..0ec23a8304
--- /dev/null
+++ b/reference/mongodb/setup.xml
@@ -0,0 +1,70 @@
+
+
+
+
+
+ &reftitle.setup;
+
+
+ &reftitle.required;
+
+ バージョン 1.21.0 以降、この拡張モジュールは PHP 8.1 以上を必要とします。以前のバージョンの拡張モジュールは古い PHP バージョンとの互換性を提供します。
+
+
+ この拡張モジュールは
+ libbson and
+ libmongoc, and will use
+ bundled versions of both libraries by default. システムライブラリも使用できます。詳しくは
+ manual installation
+ ドキュメントで説明しています。
+
+
+ この拡張モジュールは libmongoc を介して、オプションで TLS ライブラリ (例: OpenSSL) に依存し、利用可能な場合はそれを使用します。 ビルドプロセスが TLS ライブラリを見つけられない場合、ユーザーは適切な開発パッケージ
+ (e.g. libssl-dev) and
+ pkg-config がインストールされていることを確認する必要があります。TLS ライブラリの検出と設定のプロセスについては、
+ manual installation
+ ドキュメントで説明しています。
+
+
+ Cyrus SASL は Kerberos 認証をサポートするためのオプションの依存関係で、利用可能な場合に使用されます。
+
+
+
+ 32 ビットプラットフォームでの 64 ビット整数の表現に関する潜在的な問題のため、64 ビット環境を使用することをお勧めします。 32 ビットプラットフォームを使用する場合、データベースから読み取られた 64 ビット整数は PHP の整数型ではなく MongoDB\BSON\Int64 インスタンスとして返されることに注意してください。
+
+
+
+
+ &reference.mongodb.configure;
+ &reference.mongodb.ini;
+
+
+
+
+
diff --git a/reference/mongodb/tutorial.xml b/reference/mongodb/tutorial.xml
new file mode 100644
index 0000000000..631e9d8c9f
--- /dev/null
+++ b/reference/mongodb/tutorial.xml
@@ -0,0 +1,42 @@
+
+
+
+
+
+ チュートリアル
+ Tutorials
+
+
+
+
+ In this section you will find several tutorials on how to use the MongoDB
+ driver for PHP.
+
+
+
+
+ &reference.mongodb.tutorial.library;
+ &reference.mongodb.tutorial.apm;
+
+
+
+
diff --git a/reference/mongodb/tutorial/apm.xml b/reference/mongodb/tutorial/apm.xml
new file mode 100644
index 0000000000..10ad011e5c
--- /dev/null
+++ b/reference/mongodb/tutorial/apm.xml
@@ -0,0 +1,210 @@
+
+
+
+
+
+ アプリケーションパフォーマンスモニタリング (APM)
+
+
+ The extension contains an event subscriber API, which allows applications to
+ monitor commands and internal activity pertaining to the
+ Server Discovery and Monitoring Specification.
+ This tutorial will demonstrate command monitoring using the
+ MongoDB\Driver\Monitoring\CommandSubscriber interface.
+
+
+
+ The MongoDB\Driver\Monitoring\CommandSubscriber
+ interface defines three methods: commandStarted,
+ commandSucceeded, and commandFailed.
+ Each of these three methods accept a single event
+ argument of a specific class for the respective event. For example, the
+ commandSucceeded's $event argument
+ is a MongoDB\Driver\Monitoring\CommandSucceededEvent
+ object.
+
+
+
+ In this tutorial we will implement a subscriber that creates a list of all
+ the query profiles and the average time they took.
+
+
+
+ Subscriber Class Scaffolding
+
+
+ We start with the framework for our subscriber:
+
+
+
+
+]]>
+
+
+
+
+ Registering the Subscriber
+
+
+ Once a subscriber object is instantiated, it needs to be registered with the
+ extensions's monitoring system. This is done by calling
+ MongoDB\Driver\Monitoring\addSubscriber or
+ MongoDB\Driver\Manager::addSubscriber to register
+ the subscriber globally or with a specific Manager, respectively.
+
+
+
+
+]]>
+
+
+
+
+ Implementing the Logic
+
+
+ With the object registered, the only thing left is to implement the logic
+ in the subscriber class. To correlate the two events that make up a
+ successfully executed command (commandStarted and commandSucceeded), each
+ event object exposes a requestId field.
+
+
+ To record the average time per query shape, we will start by checking for a
+ find command in the commandStarted event. We will then add
+ an item to the pendingCommands property indexed by its
+ requestId and with its value representing the query shape.
+
+
+ If we receive a corresponding commandSucceeded event with the same
+ requestId, we add the duration of the event (from
+ durationMicros) to the total time and increment the
+ operation count.
+
+
+ If a corresponding commandFailed event is encountered, we just remove the
+ entry from the pendingCommands property.
+
+
+
+getCommandName() )
+ {
+ $queryShape = $this->createQueryShape( (array) $event->getCommand()->filter );
+ $this->pendingCommands[$event->getRequestId()] = $queryShape;
+ }
+ }
+
+ public function commandSucceeded( \MongoDB\Driver\Monitoring\CommandSucceededEvent $event ): void
+ {
+ $requestId = $event->getRequestId();
+ if ( array_key_exists( $requestId, $this->pendingCommands ) )
+ {
+ $this->queryShapeStats[$this->pendingCommands[$requestId]]['count']++;
+ $this->queryShapeStats[$this->pendingCommands[$requestId]]['duration'] += $event->getDurationMicros();
+ unset( $this->pendingCommands[$requestId] );
+ }
+ }
+
+ public function commandFailed( \MongoDB\Driver\Monitoring\CommandFailedEvent $event ): void
+ {
+ if ( array_key_exists( $event->getRequestId(), $this->pendingCommands ) )
+ {
+ unset( $this->pendingCommands[$event->getRequestId()] );
+ }
+ }
+
+ public function __destruct()
+ {
+ foreach( $this->queryShapeStats as $shape => $stats )
+ {
+ echo "Shape: ", $shape, " (", $stats['count'], ")\n ",
+ $stats['duration'] / $stats['count'], "µs\n\n";
+ }
+ }
+}
+
+$m = new \MongoDB\Driver\Manager( 'mongodb://localhost:27016' );
+
+/* Add the subscriber */
+\MongoDB\Driver\Monitoring\addSubscriber( new QueryTimeCollector() );
+
+/* Do a bunch of queries */
+$query = new \MongoDB\Driver\Query( [
+ 'region_slug' => 'scotland-highlands', 'age' => [ '$gte' => 20 ]
+] );
+$cursor = $m->executeQuery( 'dramio.whisky', $query );
+
+$query = new \MongoDB\Driver\Query( [
+ 'region_slug' => 'scotland-lowlands', 'age' => [ '$gte' => 15 ]
+] );
+$cursor = $m->executeQuery( 'dramio.whisky', $query );
+
+$query = new \MongoDB\Driver\Query( [ 'region_slug' => 'scotland-lowlands' ] );
+$cursor = $m->executeQuery( 'dramio.whisky', $query );
+
+?>
+]]>
+
+
+
+
+
+
diff --git a/reference/mongodb/tutorial/library.xml b/reference/mongodb/tutorial/library.xml
new file mode 100644
index 0000000000..781889094e
--- /dev/null
+++ b/reference/mongodb/tutorial/library.xml
@@ -0,0 +1,179 @@
+
+
+
+
+
+ MongoDB PHP ライブラリ (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 last thing we still need to install to get started on the application
+ itself, is the PHP library.
+
+
+
+ The library needs to be installed with
+ Composer, a package manager
+ for PHP. Instructions for installing Composer on various platforms may be
+ found on its website.
+
+
+
+ Install the library by running:
+
+
+
+
+
+
+It will output something akin to:
+
+
+
+
+
+
+
+ Composer will create several files: composer.json,
+ composer.lock, and a vendor directory that will
+ contain the library and any other dependencies your project might require.
+
+
+
+
+ Using the PHP Library
+
+
+ In addition to managing your dependencies, Composer will also provide you
+ with an autoloader (for those dependencies' classes). Ensure that it is
+ included at the start of your script or in your application's bootstrap
+ code:
+
+
+
+
+
+
+ With this done, you can now use any of the functionality as described in the
+ library documentation.
+
+
+
+ If you have used MongoDB drivers in other languages, the library's API
+ should look familiar. It contains a
+ Client
+ class for connecting to MongoDB, a
+ Database
+ class for database-level operations (e.g. commands, collection management),
+ and a
+ Collection
+ class for collection-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:
+
+demo->beers;
+
+$result = $collection->insertOne( [ 'name' => 'Hinterland', 'brewery' => 'BrewDog' ] );
+
+echo "Inserted with Object ID '{$result->getInsertedId()}'";
+?>
+]]>
+
+
+
+
+ Since the inserted document did not contain an _id field, the
+ extension will generate an MongoDB\BSON\ObjectId 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 returns an iterable
+ cursor:
+
+demo->beers;
+
+$result = $collection->find( [ 'name' => 'Hinterland', 'brewery' => 'BrewDog' ] );
+
+foreach ($result as $entry) {
+ echo $entry['_id'], ': ', $entry['name'], "\n";
+}
+?>
+]]>
+
+
+
+
+ While it may not be apparent in the examples, BSON documents and arrays are
+ unserialized as special classes in the library by default. These classes
+ extend ArrayObject for usability and implement the
+ extension's MongoDB\BSON\Serializable and
+ MongoDB\BSON\Unserializable interfaces to
+ ensure that values preserve their type when serialized back into BSON. This
+ avoids a caveat in the legacy mongo extension where arrays
+ might turn into documents, and vice versa. See the
+ specification for more information on
+ how values are converted between PHP and BSON.
+
+
+
+