From 9bdc5357b2b43d8eff992de91db286137a2fbde2 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Mon, 23 Feb 2026 14:03:35 +0100 Subject: [PATCH 1/3] =?UTF-8?q?MongoDB=20=E6=8B=A1=E5=BC=B5=E3=83=A2?= =?UTF-8?q?=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=AE=E7=BF=BB=E8=A8=B3?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0=20(448=20=E3=83=95=E3=82=A1?= =?UTF-8?q?=E3=82=A4=E3=83=AB)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit doc-en に存在するが doc-ja に欠けていた MongoDB 拡張モジュール全体の 日本語翻訳を追加します。 - MongoDB\Driver クラス群(Manager, Session, Command, Query, BulkWrite 等) - MongoDB\BSON クラス群(Document, PackedArray, Binary, ObjectId 等) - MongoDB\Monitoring インターフェイス群 - 例外クラス群 - セットアップ、設定、チュートリアル --- reference/mongodb/architecture.xml | 963 ++++++++++++ reference/mongodb/book.xml | 60 + reference/mongodb/bson.xml | 49 + reference/mongodb/bson/binary.xml | 317 ++++ reference/mongodb/bson/binary/construct.xml | 156 ++ reference/mongodb/bson/binary/fromvector.xml | 92 ++ reference/mongodb/bson/binary/getdata.xml | 91 ++ reference/mongodb/bson/binary/gettype.xml | 91 ++ .../mongodb/bson/binary/getvectortype.xml | 68 + .../mongodb/bson/binary/jsonserialize.xml | 73 + reference/mongodb/bson/binary/toarray.xml | 68 + reference/mongodb/bson/binary/tostring.xml | 86 ++ reference/mongodb/bson/binaryinterface.xml | 77 + .../mongodb/bson/binaryinterface/getdata.xml | 59 + .../mongodb/bson/binaryinterface/gettype.xml | 59 + .../mongodb/bson/binaryinterface/tostring.xml | 63 + reference/mongodb/bson/dbpointer.xml | 109 ++ .../mongodb/bson/dbpointer/construct.xml | 56 + .../mongodb/bson/dbpointer/jsonserialize.xml | 73 + reference/mongodb/bson/dbpointer/tostring.xml | 59 + reference/mongodb/bson/decimal128.xml | 134 ++ .../mongodb/bson/decimal128/construct.xml | 109 ++ .../mongodb/bson/decimal128/jsonserialize.xml | 73 + .../mongodb/bson/decimal128/tostring.xml | 87 ++ .../mongodb/bson/decimal128interface.xml | 77 + .../bson/decimal128interface/tostring.xml | 59 + reference/mongodb/bson/document.xml | 107 ++ reference/mongodb/bson/document/construct.xml | 59 + reference/mongodb/bson/document/frombson.xml | 78 + reference/mongodb/bson/document/fromjson.xml | 89 ++ reference/mongodb/bson/document/fromphp.xml | 79 + reference/mongodb/bson/document/get.xml | 85 ++ .../mongodb/bson/document/getiterator.xml | 68 + reference/mongodb/bson/document/has.xml | 76 + .../mongodb/bson/document/offsetexists.xml | 70 + reference/mongodb/bson/document/offsetget.xml | 86 ++ reference/mongodb/bson/document/offsetset.xml | 80 + .../mongodb/bson/document/offsetunset.xml | 70 + .../bson/document/tocanonicalextendedjson.xml | 142 ++ reference/mongodb/bson/document/tophp.xml | 87 ++ .../bson/document/torelaxedextendedjson.xml | 141 ++ reference/mongodb/bson/document/tostring.xml | 59 + reference/mongodb/bson/int64.xml | 132 ++ reference/mongodb/bson/int64/construct.xml | 102 ++ .../mongodb/bson/int64/jsonserialize.xml | 84 ++ reference/mongodb/bson/int64/tostring.xml | 84 ++ reference/mongodb/bson/iterator.xml | 73 + reference/mongodb/bson/iterator/construct.xml | 60 + reference/mongodb/bson/iterator/current.xml | 71 + reference/mongodb/bson/iterator/key.xml | 66 + reference/mongodb/bson/iterator/next.xml | 49 + reference/mongodb/bson/iterator/rewind.xml | 49 + reference/mongodb/bson/iterator/valid.xml | 56 + reference/mongodb/bson/javascript.xml | 132 ++ .../mongodb/bson/javascript/construct.xml | 148 ++ reference/mongodb/bson/javascript/getcode.xml | 91 ++ .../mongodb/bson/javascript/getscope.xml | 98 ++ .../mongodb/bson/javascript/jsonserialize.xml | 73 + .../mongodb/bson/javascript/tostring.xml | 86 ++ .../mongodb/bson/javascriptinterface.xml | 78 + .../bson/javascriptinterface/getcode.xml | 59 + .../bson/javascriptinterface/getscope.xml | 59 + .../bson/javascriptinterface/tostring.xml | 63 + reference/mongodb/bson/maxkey.xml | 119 ++ reference/mongodb/bson/maxkey/construct.xml | 84 ++ .../mongodb/bson/maxkey/jsonserialize.xml | 73 + reference/mongodb/bson/maxkeyinterface.xml | 57 + reference/mongodb/bson/minkey.xml | 119 ++ reference/mongodb/bson/minkey/construct.xml | 84 ++ .../mongodb/bson/minkey/jsonserialize.xml | 73 + reference/mongodb/bson/minkeyinterface.xml | 57 + reference/mongodb/bson/objectid.xml | 151 ++ reference/mongodb/bson/objectid/construct.xml | 105 ++ .../mongodb/bson/objectid/gettimestamp.xml | 100 ++ .../mongodb/bson/objectid/jsonserialize.xml | 73 + reference/mongodb/bson/objectid/tostring.xml | 85 ++ reference/mongodb/bson/objectidinterface.xml | 78 + .../bson/objectidinterface/gettimestamp.xml | 59 + .../bson/objectidinterface/tostring.xml | 59 + reference/mongodb/bson/packedarray.xml | 115 ++ .../mongodb/bson/packedarray/construct.xml | 57 + .../mongodb/bson/packedarray/fromjson.xml | 127 ++ .../mongodb/bson/packedarray/fromphp.xml | 77 + reference/mongodb/bson/packedarray/get.xml | 85 ++ .../mongodb/bson/packedarray/getiterator.xml | 68 + reference/mongodb/bson/packedarray/has.xml | 76 + .../mongodb/bson/packedarray/offsetexists.xml | 70 + .../mongodb/bson/packedarray/offsetget.xml | 86 ++ .../mongodb/bson/packedarray/offsetset.xml | 80 + .../mongodb/bson/packedarray/offsetunset.xml | 70 + .../packedarray/tocanonicalextendedjson.xml | 101 ++ reference/mongodb/bson/packedarray/tophp.xml | 81 ++ .../packedarray/torelaxedextendedjson.xml | 100 ++ .../mongodb/bson/packedarray/tostring.xml | 59 + reference/mongodb/bson/persistable.xml | 98 ++ .../bson/persistable/bsonserialize.xml | 110 ++ reference/mongodb/bson/regex.xml | 132 ++ reference/mongodb/bson/regex/construct.xml | 153 ++ reference/mongodb/bson/regex/getflags.xml | 92 ++ reference/mongodb/bson/regex/getpattern.xml | 91 ++ .../mongodb/bson/regex/jsonserialize.xml | 73 + reference/mongodb/bson/regex/tostring.xml | 83 ++ reference/mongodb/bson/regexinterface.xml | 77 + .../mongodb/bson/regexinterface/getflags.xml | 59 + .../bson/regexinterface/getpattern.xml | 59 + .../mongodb/bson/regexinterface/tostring.xml | 59 + reference/mongodb/bson/serializable.xml | 92 ++ .../bson/serializable/bsonserialize.xml | 248 ++++ reference/mongodb/bson/symbol.xml | 109 ++ reference/mongodb/bson/symbol/construct.xml | 56 + .../mongodb/bson/symbol/jsonserialize.xml | 73 + reference/mongodb/bson/symbol/tostring.xml | 59 + reference/mongodb/bson/timestamp.xml | 133 ++ .../mongodb/bson/timestamp/construct.xml | 107 ++ .../mongodb/bson/timestamp/getincrement.xml | 79 + .../mongodb/bson/timestamp/gettimestamp.xml | 79 + .../mongodb/bson/timestamp/jsonserialize.xml | 73 + reference/mongodb/bson/timestamp/tostring.xml | 83 ++ reference/mongodb/bson/timestampinterface.xml | 78 + .../bson/timestampinterface/getincrement.xml | 66 + .../bson/timestampinterface/gettimestamp.xml | 66 + .../bson/timestampinterface/tostring.xml | 59 + reference/mongodb/bson/type.xml | 69 + reference/mongodb/bson/undefined.xml | 109 ++ .../mongodb/bson/undefined/construct.xml | 56 + .../mongodb/bson/undefined/jsonserialize.xml | 73 + reference/mongodb/bson/undefined/tostring.xml | 59 + reference/mongodb/bson/unserializable.xml | 89 ++ .../bson/unserializable/bsonunserialize.xml | 146 ++ reference/mongodb/bson/utcdatetime.xml | 126 ++ .../mongodb/bson/utcdatetime/construct.xml | 167 +++ .../bson/utcdatetime/jsonserialize.xml | 73 + .../mongodb/bson/utcdatetime/todatetime.xml | 104 ++ .../bson/utcdatetime/todatetimeimmutable.xml | 104 ++ .../mongodb/bson/utcdatetime/tostring.xml | 83 ++ .../mongodb/bson/utcdatetimeinterface.xml | 78 + .../bson/utcdatetimeinterface/todatetime.xml | 61 + .../todatetimeimmutable.xml | 61 + .../bson/utcdatetimeinterface/tostring.xml | 59 + reference/mongodb/bson/vectortype.xml | 71 + reference/mongodb/configure.xml | 318 ++++ reference/mongodb/constants.xml | 55 + reference/mongodb/exceptions.xml | 72 + reference/mongodb/functions/bson/fromjson.xml | 148 ++ reference/mongodb/functions/bson/fromphp.xml | 144 ++ .../bson/tocanonicalextendedjson.xml | 187 +++ reference/mongodb/functions/bson/tojson.xml | 212 +++ reference/mongodb/functions/bson/tophp.xml | 181 +++ .../functions/bson/torelaxedextendedjson.xml | 186 +++ .../driver/monitoring/addsubscriber.xml | 91 ++ .../driver/monitoring/removesubscriber.xml | 88 ++ reference/mongodb/images/driver_arch.svg | 1 + reference/mongodb/ini.xml | 90 ++ reference/mongodb/mongodb.xml | 35 + .../mongodb/mongodb/driver/bulkwrite.xml | 226 +++ .../mongodb/driver/bulkwrite/construct.xml | 236 +++ .../mongodb/driver/bulkwrite/count.xml | 121 ++ .../mongodb/driver/bulkwrite/delete.xml | 172 +++ .../mongodb/driver/bulkwrite/insert.xml | 156 ++ .../mongodb/driver/bulkwrite/update.xml | 268 ++++ .../mongodb/driver/bulkwritecommand.xml | 203 +++ .../driver/bulkwritecommand/construct.xml | 185 +++ .../mongodb/driver/bulkwritecommand/count.xml | 93 ++ .../driver/bulkwritecommand/deletemany.xml | 134 ++ .../driver/bulkwritecommand/deleteone.xml | 134 ++ .../driver/bulkwritecommand/insertone.xml | 132 ++ .../driver/bulkwritecommand/replaceone.xml | 166 +++ .../driver/bulkwritecommand/updatemany.xml | 170 +++ .../driver/bulkwritecommand/updateone.xml | 181 +++ .../mongodb/driver/bulkwritecommandresult.xml | 72 + .../getdeletedcount.xml | 103 ++ .../getdeleteresults.xml | 115 ++ .../getinsertedcount.xml | 104 ++ .../getinsertresults.xml | 129 ++ .../getmatchedcount.xml | 108 ++ .../getmodifiedcount.xml | 108 ++ .../getupdateresults.xml | 158 ++ .../getupsertedcount.xml | 103 ++ .../bulkwritecommandresult/isacknowledged.xml | 127 ++ .../mongodb/driver/clientencryption.xml | 257 ++++ .../driver/clientencryption/addkeyaltname.xml | 92 ++ .../driver/clientencryption/construct.xml | 142 ++ .../driver/clientencryption/createdatakey.xml | 171 +++ .../driver/clientencryption/decrypt.xml | 81 ++ .../driver/clientencryption/deletekey.xml | 74 + .../driver/clientencryption/encrypt.xml | 122 ++ .../clientencryption/encryptexpression.xml | 142 ++ .../driver/clientencryption/getkey.xml | 73 + .../clientencryption/getkeybyaltname.xml | 80 + .../driver/clientencryption/getkeys.xml | 60 + .../clientencryption/removekeyaltname.xml | 92 ++ .../clientencryption/rewrapmanydatakey.xml | 151 ++ reference/mongodb/mongodb/driver/command.xml | 197 +++ .../mongodb/driver/command/construct.xml | 263 ++++ reference/mongodb/mongodb/driver/cursor.xml | 315 ++++ .../mongodb/driver/cursor/construct.xml | 60 + .../mongodb/mongodb/driver/cursor/current.xml | 58 + .../mongodb/mongodb/driver/cursor/getid.xml | 144 ++ .../mongodb/driver/cursor/getserver.xml | 146 ++ .../mongodb/mongodb/driver/cursor/isdead.xml | 157 ++ .../mongodb/mongodb/driver/cursor/key.xml | 56 + .../mongodb/mongodb/driver/cursor/next.xml | 63 + .../mongodb/mongodb/driver/cursor/rewind.xml | 68 + .../mongodb/driver/cursor/settypemap.xml | 130 ++ .../mongodb/mongodb/driver/cursor/toarray.xml | 137 ++ .../mongodb/mongodb/driver/cursor/valid.xml | 56 + reference/mongodb/mongodb/driver/cursorid.xml | 124 ++ .../mongodb/driver/cursorid/construct.xml | 58 + .../mongodb/driver/cursorid/tostring.xml | 98 ++ .../mongodb/driver/cursorinterface.xml | 104 ++ .../mongodb/driver/cursorinterface/getid.xml | 98 ++ .../driver/cursorinterface/getserver.xml | 74 + .../mongodb/driver/cursorinterface/isdead.xml | 79 + .../driver/cursorinterface/settypemap.xml | 74 + .../driver/cursorinterface/toarray.xml | 72 + .../exception/authenticationexception.xml | 84 ++ .../exception/bulkwritecommandexception.xml | 166 +++ .../geterrorreply.xml | 145 ++ .../getpartialresult.xml | 135 ++ .../getwriteconcernerrors.xml | 119 ++ .../getwriteerrors.xml | 125 ++ .../driver/exception/bulkwriteexception.xml | 141 ++ .../bulkwriteexception/getwriteresult.xml | 122 ++ .../driver/exception/commandexception.xml | 113 ++ .../commandexception/getresultdocument.xml | 63 + .../driver/exception/connectionexception.xml | 83 ++ .../exception/connectiontimeoutexception.xml | 89 ++ .../driver/exception/encryptionexception.xml | 82 ++ .../mongodb/driver/exception/exception.xml | 66 + .../exception/executiontimeoutexception.xml | 116 ++ .../exception/invalidargumentexception.xml | 81 ++ .../driver/exception/logicexception.xml | 80 + .../driver/exception/runtimeexception.xml | 146 ++ .../runtimeexception/haserrorlabel.xml | 78 + .../driver/exception/serverexception.xml | 82 ++ .../exception/sslconnectionexception.xml | 94 ++ .../exception/unexpectedvalueexception.xml | 81 ++ .../driver/exception/writeexception.xml | 161 +++ .../writeexception/getwriteresult.xml | 122 ++ reference/mongodb/mongodb/driver/manager.xml | 117 ++ .../mongodb/driver/manager/addsubscriber.xml | 98 ++ .../mongodb/driver/manager/construct.xml | 1285 +++++++++++++++++ .../driver/manager/createclientencryption.xml | 167 +++ .../driver/manager/executebulkwrite.xml | 239 +++ .../manager/executebulkwritecommand.xml | 212 +++ .../mongodb/driver/manager/executecommand.xml | 317 ++++ .../mongodb/driver/manager/executequery.xml | 233 +++ .../driver/manager/executereadcommand.xml | 113 ++ .../manager/executereadwritecommand.xml | 139 ++ .../driver/manager/executewritecommand.xml | 149 ++ .../driver/manager/getencryptedfieldsmap.xml | 71 + .../mongodb/driver/manager/getreadconcern.xml | 103 ++ .../driver/manager/getreadpreference.xml | 123 ++ .../mongodb/driver/manager/getservers.xml | 158 ++ .../driver/manager/getwriteconcern.xml | 105 ++ .../driver/manager/removesubscriber.xml | 88 ++ .../mongodb/driver/manager/selectserver.xml | 121 ++ .../mongodb/driver/manager/startsession.xml | 225 +++ .../driver/monitoring/commandfailedevent.xml | 70 + .../commandfailedevent/getcommandname.xml | 71 + .../commandfailedevent/getdatabasename.xml | 67 + .../commandfailedevent/getdurationmicros.xml | 71 + .../commandfailedevent/geterror.xml | 67 + .../monitoring/commandfailedevent/gethost.xml | 59 + .../commandfailedevent/getoperationid.xml | 83 ++ .../monitoring/commandfailedevent/getport.xml | 59 + .../commandfailedevent/getreply.xml | 74 + .../commandfailedevent/getrequestid.xml | 74 + .../commandfailedevent/getserver.xml | 105 ++ .../getserverconnectionid.xml | 67 + .../commandfailedevent/getserviceid.xml | 66 + .../driver/monitoring/commandstartedevent.xml | 70 + .../commandstartedevent/getcommand.xml | 73 + .../commandstartedevent/getcommandname.xml | 71 + .../commandstartedevent/getdatabasename.xml | 67 + .../commandstartedevent/gethost.xml | 59 + .../commandstartedevent/getoperationid.xml | 84 ++ .../commandstartedevent/getport.xml | 59 + .../commandstartedevent/getrequestid.xml | 76 + .../commandstartedevent/getserver.xml | 106 ++ .../getserverconnectionid.xml | 67 + .../commandstartedevent/getserviceid.xml | 66 + .../driver/monitoring/commandsubscriber.xml | 93 ++ .../commandsubscriber/commandfailed.xml | 81 ++ .../commandsubscriber/commandstarted.xml | 82 ++ .../commandsubscriber/commandsucceeded.xml | 82 ++ .../monitoring/commandsucceededevent.xml | 70 + .../commandsucceededevent/getcommandname.xml | 71 + .../commandsucceededevent/getdatabasename.xml | 67 + .../getdurationmicros.xml | 71 + .../commandsucceededevent/gethost.xml | 59 + .../commandsucceededevent/getoperationid.xml | 83 ++ .../commandsucceededevent/getport.xml | 59 + .../commandsucceededevent/getreply.xml | 74 + .../commandsucceededevent/getrequestid.xml | 74 + .../commandsucceededevent/getserver.xml | 107 ++ .../getserverconnectionid.xml | 67 + .../commandsucceededevent/getserviceid.xml | 66 + .../driver/monitoring/logsubscriber.xml | 185 +++ .../driver/monitoring/logsubscriber/log.xml | 98 ++ .../driver/monitoring/sdamsubscriber.xml | 95 ++ .../sdamsubscriber/serverchanged.xml | 83 ++ .../sdamsubscriber/serverclosed.xml | 81 ++ .../sdamsubscriber/serverheartbeatfailed.xml | 85 ++ .../sdamsubscriber/serverheartbeatstarted.xml | 86 ++ .../serverheartbeatsucceeded.xml | 85 ++ .../sdamsubscriber/serveropening.xml | 81 ++ .../sdamsubscriber/topologychanged.xml | 83 ++ .../sdamsubscriber/topologyclosed.xml | 91 ++ .../sdamsubscriber/topologyopening.xml | 90 ++ .../driver/monitoring/serverchangedevent.xml | 72 + .../monitoring/serverchangedevent/gethost.xml | 59 + .../serverchangedevent/getnewdescription.xml | 60 + .../monitoring/serverchangedevent/getport.xml | 59 + .../getpreviousdescription.xml | 60 + .../serverchangedevent/gettopologyid.xml | 59 + .../driver/monitoring/serverclosedevent.xml | 71 + .../monitoring/serverclosedevent/gethost.xml | 59 + .../monitoring/serverclosedevent/getport.xml | 59 + .../serverclosedevent/gettopologyid.xml | 59 + .../monitoring/serverheartbeatfailedevent.xml | 73 + .../getdurationmicros.xml | 64 + .../serverheartbeatfailedevent/geterror.xml | 60 + .../serverheartbeatfailedevent/gethost.xml | 60 + .../serverheartbeatfailedevent/getport.xml | 60 + .../serverheartbeatfailedevent/isawaited.xml | 64 + .../serverheartbeatstartedevent.xml | 73 + .../serverheartbeatstartedevent/gethost.xml | 59 + .../serverheartbeatstartedevent/getport.xml | 59 + .../serverheartbeatstartedevent/isawaited.xml | 64 + .../serverheartbeatsucceededevent.xml | 73 + .../getdurationmicros.xml | 63 + .../serverheartbeatsucceededevent/gethost.xml | 59 + .../serverheartbeatsucceededevent/getport.xml | 59 + .../getreply.xml | 74 + .../isawaited.xml | 64 + .../driver/monitoring/serveropeningevent.xml | 71 + .../monitoring/serveropeningevent/gethost.xml | 59 + .../monitoring/serveropeningevent/getport.xml | 59 + .../serveropeningevent/gettopologyid.xml | 59 + .../mongodb/driver/monitoring/subscriber.xml | 72 + .../monitoring/topologychangedevent.xml | 72 + .../getnewdescription.xml | 60 + .../getpreviousdescription.xml | 60 + .../topologychangedevent/gettopologyid.xml | 59 + .../driver/monitoring/topologyclosedevent.xml | 80 + .../topologyclosedevent/gettopologyid.xml | 59 + .../monitoring/topologyopeningevent.xml | 79 + .../topologyopeningevent/gettopologyid.xml | 59 + reference/mongodb/mongodb/driver/query.xml | 71 + .../mongodb/driver/query/construct.xml | 547 +++++++ .../mongodb/mongodb/driver/readconcern.xml | 316 ++++ .../driver/readconcern/bsonserialize.xml | 122 ++ .../mongodb/driver/readconcern/construct.xml | 99 ++ .../mongodb/driver/readconcern/getlevel.xml | 99 ++ .../mongodb/driver/readconcern/isdefault.xml | 117 ++ .../mongodb/mongodb/driver/readpreference.xml | 282 ++++ .../driver/readpreference/bsonserialize.xml | 182 +++ .../driver/readpreference/construct.xml | 341 +++++ .../driver/readpreference/gethedge.xml | 67 + .../readpreference/getmaxstalenessseconds.xml | 112 ++ .../mongodb/driver/readpreference/getmode.xml | 137 ++ .../driver/readpreference/getmodestring.xml | 108 ++ .../driver/readpreference/gettagsets.xml | 140 ++ reference/mongodb/mongodb/driver/server.xml | 240 +++ .../mongodb/driver/server/construct.xml | 61 + .../driver/server/executebulkwrite.xml | 178 +++ .../driver/server/executebulkwritecommand.xml | 114 ++ .../mongodb/driver/server/executecommand.xml | 174 +++ .../mongodb/driver/server/executequery.xml | 146 ++ .../driver/server/executereadcommand.xml | 114 ++ .../driver/server/executereadwritecommand.xml | 144 ++ .../driver/server/executewritecommand.xml | 154 ++ .../mongodb/mongodb/driver/server/gethost.xml | 97 ++ .../mongodb/mongodb/driver/server/getinfo.xml | 263 ++++ .../mongodb/driver/server/getlatency.xml | 126 ++ .../mongodb/mongodb/driver/server/getport.xml | 97 ++ .../driver/server/getserverdescription.xml | 65 + .../mongodb/mongodb/driver/server/gettags.xml | 74 + .../mongodb/mongodb/driver/server/gettype.xml | 72 + .../mongodb/driver/server/isarbiter.xml | 74 + .../mongodb/driver/server/ishidden.xml | 74 + .../mongodb/driver/server/ispassive.xml | 74 + .../mongodb/driver/server/isprimary.xml | 74 + .../mongodb/driver/server/issecondary.xml | 74 + .../mongodb/mongodb/driver/serverapi.xml | 186 +++ .../driver/serverapi/bsonserialize.xml | 67 + .../mongodb/driver/serverapi/construct.xml | 89 ++ .../mongodb/driver/serverdescription.xml | 216 +++ .../serverdescription/gethelloresponse.xml | 86 ++ .../driver/serverdescription/gethost.xml | 69 + .../serverdescription/getlastupdatetime.xml | 69 + .../driver/serverdescription/getport.xml | 69 + .../serverdescription/getroundtriptime.xml | 72 + .../driver/serverdescription/gettype.xml | 71 + reference/mongodb/mongodb/driver/session.xml | 158 ++ .../driver/session/aborttransaction.xml | 74 + .../driver/session/advanceclustertime.xml | 90 ++ .../driver/session/advanceoperationtime.xml | 91 ++ .../driver/session/committransaction.xml | 90 ++ .../mongodb/driver/session/construct.xml | 57 + .../mongodb/driver/session/endsession.xml | 80 + .../mongodb/driver/session/getclustertime.xml | 73 + .../driver/session/getlogicalsessionid.xml | 63 + .../driver/session/getoperationtime.xml | 73 + .../mongodb/driver/session/getserver.xml | 71 + .../driver/session/gettransactionoptions.xml | 70 + .../driver/session/gettransactionstate.xml | 70 + .../mongodb/driver/session/isdirty.xml | 63 + .../driver/session/isintransaction.xml | 72 + .../driver/session/starttransaction.xml | 146 ++ .../mongodb/driver/topologydescription.xml | 161 +++ .../driver/topologydescription/getservers.xml | 64 + .../driver/topologydescription/gettype.xml | 64 + .../topologydescription/hasreadableserver.xml | 66 + .../topologydescription/haswritableserver.xml | 62 + .../mongodb/mongodb/driver/writeconcern.xml | 138 ++ .../driver/writeconcern/bsonserialize.xml | 128 ++ .../mongodb/driver/writeconcern/construct.xml | 232 +++ .../driver/writeconcern/getjournal.xml | 99 ++ .../mongodb/driver/writeconcern/getw.xml | 95 ++ .../driver/writeconcern/getwtimeout.xml | 121 ++ .../mongodb/driver/writeconcern/isdefault.xml | 117 ++ .../mongodb/driver/writeconcernerror.xml | 71 + .../driver/writeconcernerror/getcode.xml | 105 ++ .../driver/writeconcernerror/getinfo.xml | 109 ++ .../driver/writeconcernerror/getmessage.xml | 105 ++ .../mongodb/mongodb/driver/writeerror.xml | 71 + .../mongodb/driver/writeerror/getcode.xml | 96 ++ .../mongodb/driver/writeerror/getindex.xml | 106 ++ .../mongodb/driver/writeerror/getinfo.xml | 64 + .../mongodb/driver/writeerror/getmessage.xml | 96 ++ .../mongodb/mongodb/driver/writeresult.xml | 73 + .../driver/writeresult/getdeletedcount.xml | 124 ++ .../driver/writeresult/getinsertedcount.xml | 124 ++ .../driver/writeresult/getmatchedcount.xml | 127 ++ .../driver/writeresult/getmodifiedcount.xml | 127 ++ .../mongodb/driver/writeresult/getserver.xml | 105 ++ .../driver/writeresult/getupsertedcount.xml | 125 ++ .../driver/writeresult/getupsertedids.xml | 120 ++ .../writeresult/getwriteconcernerror.xml | 118 ++ .../driver/writeresult/getwriteerrors.xml | 183 +++ .../driver/writeresult/isacknowledged.xml | 130 ++ reference/mongodb/monitoring.xml | 32 + reference/mongodb/security.xml | 183 +++ reference/mongodb/setup.xml | 70 + reference/mongodb/tutorial.xml | 42 + reference/mongodb/tutorial/apm.xml | 210 +++ reference/mongodb/tutorial/library.xml | 179 +++ 449 files changed, 47755 insertions(+) create mode 100644 reference/mongodb/architecture.xml create mode 100644 reference/mongodb/book.xml create mode 100644 reference/mongodb/bson.xml create mode 100644 reference/mongodb/bson/binary.xml create mode 100644 reference/mongodb/bson/binary/construct.xml create mode 100644 reference/mongodb/bson/binary/fromvector.xml create mode 100644 reference/mongodb/bson/binary/getdata.xml create mode 100644 reference/mongodb/bson/binary/gettype.xml create mode 100644 reference/mongodb/bson/binary/getvectortype.xml create mode 100644 reference/mongodb/bson/binary/jsonserialize.xml create mode 100644 reference/mongodb/bson/binary/toarray.xml create mode 100644 reference/mongodb/bson/binary/tostring.xml create mode 100644 reference/mongodb/bson/binaryinterface.xml create mode 100644 reference/mongodb/bson/binaryinterface/getdata.xml create mode 100644 reference/mongodb/bson/binaryinterface/gettype.xml create mode 100644 reference/mongodb/bson/binaryinterface/tostring.xml create mode 100644 reference/mongodb/bson/dbpointer.xml create mode 100644 reference/mongodb/bson/dbpointer/construct.xml create mode 100644 reference/mongodb/bson/dbpointer/jsonserialize.xml create mode 100644 reference/mongodb/bson/dbpointer/tostring.xml create mode 100644 reference/mongodb/bson/decimal128.xml create mode 100644 reference/mongodb/bson/decimal128/construct.xml create mode 100644 reference/mongodb/bson/decimal128/jsonserialize.xml create mode 100644 reference/mongodb/bson/decimal128/tostring.xml create mode 100644 reference/mongodb/bson/decimal128interface.xml create mode 100644 reference/mongodb/bson/decimal128interface/tostring.xml create mode 100644 reference/mongodb/bson/document.xml create mode 100644 reference/mongodb/bson/document/construct.xml create mode 100644 reference/mongodb/bson/document/frombson.xml create mode 100644 reference/mongodb/bson/document/fromjson.xml create mode 100644 reference/mongodb/bson/document/fromphp.xml create mode 100644 reference/mongodb/bson/document/get.xml create mode 100644 reference/mongodb/bson/document/getiterator.xml create mode 100644 reference/mongodb/bson/document/has.xml create mode 100644 reference/mongodb/bson/document/offsetexists.xml create mode 100644 reference/mongodb/bson/document/offsetget.xml create mode 100644 reference/mongodb/bson/document/offsetset.xml create mode 100644 reference/mongodb/bson/document/offsetunset.xml create mode 100644 reference/mongodb/bson/document/tocanonicalextendedjson.xml create mode 100644 reference/mongodb/bson/document/tophp.xml create mode 100644 reference/mongodb/bson/document/torelaxedextendedjson.xml create mode 100644 reference/mongodb/bson/document/tostring.xml create mode 100644 reference/mongodb/bson/int64.xml create mode 100644 reference/mongodb/bson/int64/construct.xml create mode 100644 reference/mongodb/bson/int64/jsonserialize.xml create mode 100644 reference/mongodb/bson/int64/tostring.xml create mode 100644 reference/mongodb/bson/iterator.xml create mode 100644 reference/mongodb/bson/iterator/construct.xml create mode 100644 reference/mongodb/bson/iterator/current.xml create mode 100644 reference/mongodb/bson/iterator/key.xml create mode 100644 reference/mongodb/bson/iterator/next.xml create mode 100644 reference/mongodb/bson/iterator/rewind.xml create mode 100644 reference/mongodb/bson/iterator/valid.xml create mode 100644 reference/mongodb/bson/javascript.xml create mode 100644 reference/mongodb/bson/javascript/construct.xml create mode 100644 reference/mongodb/bson/javascript/getcode.xml create mode 100644 reference/mongodb/bson/javascript/getscope.xml create mode 100644 reference/mongodb/bson/javascript/jsonserialize.xml create mode 100644 reference/mongodb/bson/javascript/tostring.xml create mode 100644 reference/mongodb/bson/javascriptinterface.xml create mode 100644 reference/mongodb/bson/javascriptinterface/getcode.xml create mode 100644 reference/mongodb/bson/javascriptinterface/getscope.xml create mode 100644 reference/mongodb/bson/javascriptinterface/tostring.xml create mode 100644 reference/mongodb/bson/maxkey.xml create mode 100644 reference/mongodb/bson/maxkey/construct.xml create mode 100644 reference/mongodb/bson/maxkey/jsonserialize.xml create mode 100644 reference/mongodb/bson/maxkeyinterface.xml create mode 100644 reference/mongodb/bson/minkey.xml create mode 100644 reference/mongodb/bson/minkey/construct.xml create mode 100644 reference/mongodb/bson/minkey/jsonserialize.xml create mode 100644 reference/mongodb/bson/minkeyinterface.xml create mode 100644 reference/mongodb/bson/objectid.xml create mode 100644 reference/mongodb/bson/objectid/construct.xml create mode 100644 reference/mongodb/bson/objectid/gettimestamp.xml create mode 100644 reference/mongodb/bson/objectid/jsonserialize.xml create mode 100644 reference/mongodb/bson/objectid/tostring.xml create mode 100644 reference/mongodb/bson/objectidinterface.xml create mode 100644 reference/mongodb/bson/objectidinterface/gettimestamp.xml create mode 100644 reference/mongodb/bson/objectidinterface/tostring.xml create mode 100644 reference/mongodb/bson/packedarray.xml create mode 100644 reference/mongodb/bson/packedarray/construct.xml create mode 100644 reference/mongodb/bson/packedarray/fromjson.xml create mode 100644 reference/mongodb/bson/packedarray/fromphp.xml create mode 100644 reference/mongodb/bson/packedarray/get.xml create mode 100644 reference/mongodb/bson/packedarray/getiterator.xml create mode 100644 reference/mongodb/bson/packedarray/has.xml create mode 100644 reference/mongodb/bson/packedarray/offsetexists.xml create mode 100644 reference/mongodb/bson/packedarray/offsetget.xml create mode 100644 reference/mongodb/bson/packedarray/offsetset.xml create mode 100644 reference/mongodb/bson/packedarray/offsetunset.xml create mode 100644 reference/mongodb/bson/packedarray/tocanonicalextendedjson.xml create mode 100644 reference/mongodb/bson/packedarray/tophp.xml create mode 100644 reference/mongodb/bson/packedarray/torelaxedextendedjson.xml create mode 100644 reference/mongodb/bson/packedarray/tostring.xml create mode 100644 reference/mongodb/bson/persistable.xml create mode 100644 reference/mongodb/bson/persistable/bsonserialize.xml create mode 100644 reference/mongodb/bson/regex.xml create mode 100644 reference/mongodb/bson/regex/construct.xml create mode 100644 reference/mongodb/bson/regex/getflags.xml create mode 100644 reference/mongodb/bson/regex/getpattern.xml create mode 100644 reference/mongodb/bson/regex/jsonserialize.xml create mode 100644 reference/mongodb/bson/regex/tostring.xml create mode 100644 reference/mongodb/bson/regexinterface.xml create mode 100644 reference/mongodb/bson/regexinterface/getflags.xml create mode 100644 reference/mongodb/bson/regexinterface/getpattern.xml create mode 100644 reference/mongodb/bson/regexinterface/tostring.xml create mode 100644 reference/mongodb/bson/serializable.xml create mode 100644 reference/mongodb/bson/serializable/bsonserialize.xml create mode 100644 reference/mongodb/bson/symbol.xml create mode 100644 reference/mongodb/bson/symbol/construct.xml create mode 100644 reference/mongodb/bson/symbol/jsonserialize.xml create mode 100644 reference/mongodb/bson/symbol/tostring.xml create mode 100644 reference/mongodb/bson/timestamp.xml create mode 100644 reference/mongodb/bson/timestamp/construct.xml create mode 100644 reference/mongodb/bson/timestamp/getincrement.xml create mode 100644 reference/mongodb/bson/timestamp/gettimestamp.xml create mode 100644 reference/mongodb/bson/timestamp/jsonserialize.xml create mode 100644 reference/mongodb/bson/timestamp/tostring.xml create mode 100644 reference/mongodb/bson/timestampinterface.xml create mode 100644 reference/mongodb/bson/timestampinterface/getincrement.xml create mode 100644 reference/mongodb/bson/timestampinterface/gettimestamp.xml create mode 100644 reference/mongodb/bson/timestampinterface/tostring.xml create mode 100644 reference/mongodb/bson/type.xml create mode 100644 reference/mongodb/bson/undefined.xml create mode 100644 reference/mongodb/bson/undefined/construct.xml create mode 100644 reference/mongodb/bson/undefined/jsonserialize.xml create mode 100644 reference/mongodb/bson/undefined/tostring.xml create mode 100644 reference/mongodb/bson/unserializable.xml create mode 100644 reference/mongodb/bson/unserializable/bsonunserialize.xml create mode 100644 reference/mongodb/bson/utcdatetime.xml create mode 100644 reference/mongodb/bson/utcdatetime/construct.xml create mode 100644 reference/mongodb/bson/utcdatetime/jsonserialize.xml create mode 100644 reference/mongodb/bson/utcdatetime/todatetime.xml create mode 100644 reference/mongodb/bson/utcdatetime/todatetimeimmutable.xml create mode 100644 reference/mongodb/bson/utcdatetime/tostring.xml create mode 100644 reference/mongodb/bson/utcdatetimeinterface.xml create mode 100644 reference/mongodb/bson/utcdatetimeinterface/todatetime.xml create mode 100644 reference/mongodb/bson/utcdatetimeinterface/todatetimeimmutable.xml create mode 100644 reference/mongodb/bson/utcdatetimeinterface/tostring.xml create mode 100644 reference/mongodb/bson/vectortype.xml create mode 100644 reference/mongodb/configure.xml create mode 100644 reference/mongodb/constants.xml create mode 100644 reference/mongodb/exceptions.xml create mode 100644 reference/mongodb/functions/bson/fromjson.xml create mode 100644 reference/mongodb/functions/bson/fromphp.xml create mode 100644 reference/mongodb/functions/bson/tocanonicalextendedjson.xml create mode 100644 reference/mongodb/functions/bson/tojson.xml create mode 100644 reference/mongodb/functions/bson/tophp.xml create mode 100644 reference/mongodb/functions/bson/torelaxedextendedjson.xml create mode 100644 reference/mongodb/functions/driver/monitoring/addsubscriber.xml create mode 100644 reference/mongodb/functions/driver/monitoring/removesubscriber.xml create mode 100644 reference/mongodb/images/driver_arch.svg create mode 100644 reference/mongodb/ini.xml create mode 100644 reference/mongodb/mongodb.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwrite.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwrite/construct.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwrite/count.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwrite/delete.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwrite/insert.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwrite/update.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommand.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommand/construct.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommand/count.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommand/deletemany.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommand/deleteone.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommand/insertone.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommand/replaceone.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommand/updatemany.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommand/updateone.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult/getdeletedcount.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult/getdeleteresults.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult/getinsertedcount.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult/getinsertresults.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult/getmatchedcount.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult/getmodifiedcount.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult/getupdateresults.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult/getupsertedcount.xml create mode 100644 reference/mongodb/mongodb/driver/bulkwritecommandresult/isacknowledged.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/addkeyaltname.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/construct.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/createdatakey.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/decrypt.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/deletekey.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/encrypt.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/encryptexpression.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/getkey.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/getkeybyaltname.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/getkeys.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/removekeyaltname.xml create mode 100644 reference/mongodb/mongodb/driver/clientencryption/rewrapmanydatakey.xml create mode 100644 reference/mongodb/mongodb/driver/command.xml create mode 100644 reference/mongodb/mongodb/driver/command/construct.xml create mode 100644 reference/mongodb/mongodb/driver/cursor.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/construct.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/current.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/getid.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/getserver.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/isdead.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/key.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/next.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/rewind.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/settypemap.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/toarray.xml create mode 100644 reference/mongodb/mongodb/driver/cursor/valid.xml create mode 100644 reference/mongodb/mongodb/driver/cursorid.xml create mode 100644 reference/mongodb/mongodb/driver/cursorid/construct.xml create mode 100644 reference/mongodb/mongodb/driver/cursorid/tostring.xml create mode 100644 reference/mongodb/mongodb/driver/cursorinterface.xml create mode 100644 reference/mongodb/mongodb/driver/cursorinterface/getid.xml create mode 100644 reference/mongodb/mongodb/driver/cursorinterface/getserver.xml create mode 100644 reference/mongodb/mongodb/driver/cursorinterface/isdead.xml create mode 100644 reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml create mode 100644 reference/mongodb/mongodb/driver/cursorinterface/toarray.xml create mode 100644 reference/mongodb/mongodb/driver/exception/authenticationexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/bulkwritecommandexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/geterrorreply.xml create mode 100644 reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getpartialresult.xml create mode 100644 reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getwriteconcernerrors.xml create mode 100644 reference/mongodb/mongodb/driver/exception/bulkwritecommandexception/getwriteerrors.xml create mode 100644 reference/mongodb/mongodb/driver/exception/bulkwriteexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/bulkwriteexception/getwriteresult.xml create mode 100644 reference/mongodb/mongodb/driver/exception/commandexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/commandexception/getresultdocument.xml create mode 100644 reference/mongodb/mongodb/driver/exception/connectionexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/connectiontimeoutexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/encryptionexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/exception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/executiontimeoutexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/invalidargumentexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/logicexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/runtimeexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/runtimeexception/haserrorlabel.xml create mode 100644 reference/mongodb/mongodb/driver/exception/serverexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/sslconnectionexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/unexpectedvalueexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/writeexception.xml create mode 100644 reference/mongodb/mongodb/driver/exception/writeexception/getwriteresult.xml create mode 100644 reference/mongodb/mongodb/driver/manager.xml create mode 100644 reference/mongodb/mongodb/driver/manager/addsubscriber.xml create mode 100644 reference/mongodb/mongodb/driver/manager/construct.xml create mode 100644 reference/mongodb/mongodb/driver/manager/createclientencryption.xml create mode 100644 reference/mongodb/mongodb/driver/manager/executebulkwrite.xml create mode 100644 reference/mongodb/mongodb/driver/manager/executebulkwritecommand.xml create mode 100644 reference/mongodb/mongodb/driver/manager/executecommand.xml create mode 100644 reference/mongodb/mongodb/driver/manager/executequery.xml create mode 100644 reference/mongodb/mongodb/driver/manager/executereadcommand.xml create mode 100644 reference/mongodb/mongodb/driver/manager/executereadwritecommand.xml create mode 100644 reference/mongodb/mongodb/driver/manager/executewritecommand.xml create mode 100644 reference/mongodb/mongodb/driver/manager/getencryptedfieldsmap.xml create mode 100644 reference/mongodb/mongodb/driver/manager/getreadconcern.xml create mode 100644 reference/mongodb/mongodb/driver/manager/getreadpreference.xml create mode 100644 reference/mongodb/mongodb/driver/manager/getservers.xml create mode 100644 reference/mongodb/mongodb/driver/manager/getwriteconcern.xml create mode 100644 reference/mongodb/mongodb/driver/manager/removesubscriber.xml create mode 100644 reference/mongodb/mongodb/driver/manager/selectserver.xml create mode 100644 reference/mongodb/mongodb/driver/manager/startsession.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getcommandname.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getdatabasename.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getdurationmicros.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/geterror.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getoperationid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getport.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getreply.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getrequestid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserver.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserverconnectionid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandfailedevent/getserviceid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getcommand.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getcommandname.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getdatabasename.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getoperationid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getport.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getrequestid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserver.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserverconnectionid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandstartedevent/getserviceid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsubscriber.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandfailed.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandstarted.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsubscriber/commandsucceeded.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getcommandname.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getdatabasename.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getdurationmicros.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getoperationid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getport.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getreply.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getrequestid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserver.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserverconnectionid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/commandsucceededevent/getserviceid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/logsubscriber.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/logsubscriber/log.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverchanged.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverclosed.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatfailed.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatstarted.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serverheartbeatsucceeded.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/serveropening.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologychanged.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologyclosed.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/sdamsubscriber/topologyopening.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverchangedevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverchangedevent/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getnewdescription.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getport.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverchangedevent/getpreviousdescription.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverchangedevent/gettopologyid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverclosedevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverclosedevent/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverclosedevent/getport.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverclosedevent/gettopologyid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/getdurationmicros.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/geterror.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/getport.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatfailedevent/isawaited.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/getport.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatstartedevent/isawaited.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getdurationmicros.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getport.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/getreply.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serverheartbeatsucceededevent/isawaited.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serveropeningevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serveropeningevent/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serveropeningevent/getport.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/serveropeningevent/gettopologyid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/subscriber.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/topologychangedevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/topologychangedevent/getnewdescription.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/topologychangedevent/getpreviousdescription.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/topologychangedevent/gettopologyid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/topologyclosedevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/topologyclosedevent/gettopologyid.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/topologyopeningevent.xml create mode 100644 reference/mongodb/mongodb/driver/monitoring/topologyopeningevent/gettopologyid.xml create mode 100644 reference/mongodb/mongodb/driver/query.xml create mode 100644 reference/mongodb/mongodb/driver/query/construct.xml create mode 100644 reference/mongodb/mongodb/driver/readconcern.xml create mode 100644 reference/mongodb/mongodb/driver/readconcern/bsonserialize.xml create mode 100644 reference/mongodb/mongodb/driver/readconcern/construct.xml create mode 100644 reference/mongodb/mongodb/driver/readconcern/getlevel.xml create mode 100644 reference/mongodb/mongodb/driver/readconcern/isdefault.xml create mode 100644 reference/mongodb/mongodb/driver/readpreference.xml create mode 100644 reference/mongodb/mongodb/driver/readpreference/bsonserialize.xml create mode 100644 reference/mongodb/mongodb/driver/readpreference/construct.xml create mode 100644 reference/mongodb/mongodb/driver/readpreference/gethedge.xml create mode 100644 reference/mongodb/mongodb/driver/readpreference/getmaxstalenessseconds.xml create mode 100644 reference/mongodb/mongodb/driver/readpreference/getmode.xml create mode 100644 reference/mongodb/mongodb/driver/readpreference/getmodestring.xml create mode 100644 reference/mongodb/mongodb/driver/readpreference/gettagsets.xml create mode 100644 reference/mongodb/mongodb/driver/server.xml create mode 100644 reference/mongodb/mongodb/driver/server/construct.xml create mode 100644 reference/mongodb/mongodb/driver/server/executebulkwrite.xml create mode 100644 reference/mongodb/mongodb/driver/server/executebulkwritecommand.xml create mode 100644 reference/mongodb/mongodb/driver/server/executecommand.xml create mode 100644 reference/mongodb/mongodb/driver/server/executequery.xml create mode 100644 reference/mongodb/mongodb/driver/server/executereadcommand.xml create mode 100644 reference/mongodb/mongodb/driver/server/executereadwritecommand.xml create mode 100644 reference/mongodb/mongodb/driver/server/executewritecommand.xml create mode 100644 reference/mongodb/mongodb/driver/server/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/server/getinfo.xml create mode 100644 reference/mongodb/mongodb/driver/server/getlatency.xml create mode 100644 reference/mongodb/mongodb/driver/server/getport.xml create mode 100644 reference/mongodb/mongodb/driver/server/getserverdescription.xml create mode 100644 reference/mongodb/mongodb/driver/server/gettags.xml create mode 100644 reference/mongodb/mongodb/driver/server/gettype.xml create mode 100644 reference/mongodb/mongodb/driver/server/isarbiter.xml create mode 100644 reference/mongodb/mongodb/driver/server/ishidden.xml create mode 100644 reference/mongodb/mongodb/driver/server/ispassive.xml create mode 100644 reference/mongodb/mongodb/driver/server/isprimary.xml create mode 100644 reference/mongodb/mongodb/driver/server/issecondary.xml create mode 100644 reference/mongodb/mongodb/driver/serverapi.xml create mode 100644 reference/mongodb/mongodb/driver/serverapi/bsonserialize.xml create mode 100644 reference/mongodb/mongodb/driver/serverapi/construct.xml create mode 100644 reference/mongodb/mongodb/driver/serverdescription.xml create mode 100644 reference/mongodb/mongodb/driver/serverdescription/gethelloresponse.xml create mode 100644 reference/mongodb/mongodb/driver/serverdescription/gethost.xml create mode 100644 reference/mongodb/mongodb/driver/serverdescription/getlastupdatetime.xml create mode 100644 reference/mongodb/mongodb/driver/serverdescription/getport.xml create mode 100644 reference/mongodb/mongodb/driver/serverdescription/getroundtriptime.xml create mode 100644 reference/mongodb/mongodb/driver/serverdescription/gettype.xml create mode 100644 reference/mongodb/mongodb/driver/session.xml create mode 100644 reference/mongodb/mongodb/driver/session/aborttransaction.xml create mode 100644 reference/mongodb/mongodb/driver/session/advanceclustertime.xml create mode 100644 reference/mongodb/mongodb/driver/session/advanceoperationtime.xml create mode 100644 reference/mongodb/mongodb/driver/session/committransaction.xml create mode 100644 reference/mongodb/mongodb/driver/session/construct.xml create mode 100644 reference/mongodb/mongodb/driver/session/endsession.xml create mode 100644 reference/mongodb/mongodb/driver/session/getclustertime.xml create mode 100644 reference/mongodb/mongodb/driver/session/getlogicalsessionid.xml create mode 100644 reference/mongodb/mongodb/driver/session/getoperationtime.xml create mode 100644 reference/mongodb/mongodb/driver/session/getserver.xml create mode 100644 reference/mongodb/mongodb/driver/session/gettransactionoptions.xml create mode 100644 reference/mongodb/mongodb/driver/session/gettransactionstate.xml create mode 100644 reference/mongodb/mongodb/driver/session/isdirty.xml create mode 100644 reference/mongodb/mongodb/driver/session/isintransaction.xml create mode 100644 reference/mongodb/mongodb/driver/session/starttransaction.xml create mode 100644 reference/mongodb/mongodb/driver/topologydescription.xml create mode 100644 reference/mongodb/mongodb/driver/topologydescription/getservers.xml create mode 100644 reference/mongodb/mongodb/driver/topologydescription/gettype.xml create mode 100644 reference/mongodb/mongodb/driver/topologydescription/hasreadableserver.xml create mode 100644 reference/mongodb/mongodb/driver/topologydescription/haswritableserver.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcern.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcern/bsonserialize.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcern/construct.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcern/getjournal.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcern/getw.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcern/getwtimeout.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcern/isdefault.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcernerror.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcernerror/getcode.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcernerror/getinfo.xml create mode 100644 reference/mongodb/mongodb/driver/writeconcernerror/getmessage.xml create mode 100644 reference/mongodb/mongodb/driver/writeerror.xml create mode 100644 reference/mongodb/mongodb/driver/writeerror/getcode.xml create mode 100644 reference/mongodb/mongodb/driver/writeerror/getindex.xml create mode 100644 reference/mongodb/mongodb/driver/writeerror/getinfo.xml create mode 100644 reference/mongodb/mongodb/driver/writeerror/getmessage.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/getdeletedcount.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/getinsertedcount.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/getmatchedcount.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/getmodifiedcount.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/getserver.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/getupsertedcount.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/getupsertedids.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/getwriteconcernerror.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/getwriteerrors.xml create mode 100644 reference/mongodb/mongodb/driver/writeresult/isacknowledged.xml create mode 100644 reference/mongodb/monitoring.xml create mode 100644 reference/mongodb/security.xml create mode 100644 reference/mongodb/setup.xml create mode 100644 reference/mongodb/tutorial.xml create mode 100644 reference/mongodb/tutorial/apm.xml create mode 100644 reference/mongodb/tutorial/library.xml diff --git a/reference/mongodb/architecture.xml b/reference/mongodb/architecture.xml new file mode 100644 index 0000000000..1c73278eea --- /dev/null +++ b/reference/mongodb/architecture.xml @@ -0,0 +1,963 @@ + + + + + + ドライバのアーキテクチャと内部構造 + ドライバのアーキテクチャと特殊機能の説明 + +
+ アーキテクチャ + アーキテクチャの概要 + + + この記事では、基盤となるシステムライブラリから、拡張モジュール、そして PHP ライブラリまで、PHP ドライバのさまざまなコンポーネントがどのように連携するかを説明します。 + + + + + + MongoDB PHP ドライバのアーキテクチャ図。ドライバの最下層はシステムライブラリ: libmongoc、libbson、libmongocrypt です。中間層は MongoDB PHP 拡張モジュールです。上層は PHP ユーザーランドで、MongoDB PHP ライブラリやフレームワーク統合やアプリケーションなどの高レベルパッケージが含まれます。 + + + + + + + + + このスタックの最上位に位置するのは + PHP ライブラリで、 + Composer パッケージとして配布されています。 + このライブラリは他の MongoDB + ドライバと一貫した API を提供し、さまざまなクロスドライバの + 仕様を実装しています。 + 拡張モジュールを直接使用することもできますが、ライブラリのオーバーヘッドは最小限であり、MongoDB を使用して構築されるほとんどのアプリケーションの一般的な依存関係となるべきです。 + + + + そのライブラリの下にあるのが PHP 拡張モジュールで、 + PECLを通じて配布されています。拡張モジュールは PHP とシステムライブラリ + (libmongoc, + libbson, and + libmongocrypt). + の間の接着剤の役割を果たします。公開 API は最も基本的な機能のみを提供します: + + + 接続管理 + BSON のエンコードとデコード + オブジェクトドキュメントのシリアライズ (ODM ライブラリのサポート) + コマンド、クエリ、書き込み操作の実行 + コマンドおよびクエリ結果のカーソル処理 + + + + + + ドライバのソースコードと JIRA プロジェクト + + + + Project + GitHub + JIRA + + + + + PHP Library + mongodb/mongo-php-library + PHPLIB + + + PHP Extension + mongodb/mongo-php-driver + PHPC + + + +
+
+
+ +
+ 接続 + 接続の処理と持続性 + + &mongodb.note.forking; + +
+ 接続とトポロジーの持続性 (PHP バージョン 1.2.0 以降) + + + 1.2.0 以降のすべてのバージョンの拡張モジュールは、 + libmongoc クライアントオブジェクトを PHP ワーカープロセス内で持続させます。これにより、複数のリクエストにわたってデータベース接続、認証状態、およびトポロジー情報を再利用できます。 + + + + When MongoDB\Driver\Manager::__construct が呼び出されると、その引数 (つまり URI 文字列と配列オプション) からハッシュが作成されます。 拡張モジュールは、そのハッシュに対して以前に持続した + libmongoc クライアントオブジェクトを見つけようとします。ハッシュに対して既存のクライアントが見つからない場合、新しいクライアントが作成され、将来の使用のために持続されます。 This behavior can be disabled + via the "disableClientPersistence" driver option. + + + + 各クライアントは独自のデータベース接続とサーバートポロジーのビュー (例: スタンドアロン、レプリカセット、シャードクラスター) を持っています。 PHP リクエスト間でクライアントを持続させることで、拡張モジュールは確立されたデータベース接続を再利用し、各リクエストごとの + サーバートポロジーの検出の必要性を排除できます。 + + + + 次の例を考えてみましょう: + + + + 'myReplicaSet']), +]; + +foreach ($managers as $manager) { + $manager->executeCommand('test', new MongoDB\Driver\Command(['ping' => 1])); +} + +?> +]]> + + + + 最初の 2 つの Manager オブジェクトは、コンストラクタの引数が同一であるため、同じ + libmongoc クライアントを共有します。3 番目と 4 番目のオブジェクトはそれぞれ独自のクライアントを使用します。 合計で 3 つのクライアントが作成され、このスクリプトを実行する PHP ワーカーは + 127.0.0.1 への 2 つの接続と、 + rs1.example.com and rs2.example.com. + If the extension discovers additional members of the replica set after + issuing hello commands, it will open additional + connections to those servers as well. + + + + If the same worker executes the script again in a second request, the three + clients will be re-used and no new connections will be made. Depending on + how long ago the previous request was served, the extension may need to + issue additional hello commands to update its view of the + topologies. + +
+ +
+ ソケットの持続性 (PHP バージョン 1.2.0 より前) + + + Versions of the extension before 1.2.0 utilize PHP's Streams API for + database connections, using an API within + libmongoc to designate + custom handlers for socket communication; however, a new libmongoc client is + created for each MongoDB\Driver\Manager. As a result, + the extension persists individual database connections but not + authentication state or topology information. This means that the extension + needs to issue commands at the start of each request to authenticate and + discover the server topology. + + + + Database connections are persisted by a hash derived from the server's + host, port, and the URI string used to construct the + MongoDB\Driver\Manager. The constructor's array + options are not included in this hash. + + + + + Versions of the extension >= 1.1.8 and < 1.2.0 do not persist sockets + for SSL connections. See + PHPC-720 for + additional information. + + + + + Despite its shortcomings with persisting SSL connections when and topology + information, this version of the extension supports all + SSL context options since it uses + PHP's Streams API. + +
+
+ +
+ データの永続化 + PHP 変数の MongoDB へのシリアライズとデシリアライズ + + + このドキュメントでは、複合構造 (ドキュメント、配列、オブジェクト) が BSON と PHP の値の間でどのように変換されるかについて説明します。 + + +
+ BSON へのシリアライズ + +
+ 配列 + + + 配列がパック配列の場合 — つまり空の配列、またはキーが 0 から始まり連続していてギャップがない場合: BSON 配列。 + + + + If the array is not packed — i.e. having associative (string) keys, the + keys don't start at 0, or when there are gaps:: BSON + object + + + + トップレベル (ルート) ドキュメントは、常に BSON ドキュメントとしてシリアライズされます。 + + +
+ + + + これらは BSON 配列としてシリアライズされます: + + + + [ 8, 5, 2, 3 ] +[ 0 => 4, 1 => 9 ] => [ 4, 9 ] +]]> + + + + これらは BSON ドキュメントとしてシリアライズされます: + + + + 1, 2 => 8, 3 => 12 ] => { "0" : 1, "2" : 8, "3" : 12 } +[ "foo" => 42 ] => { "foo" : 42 } +[ 1 => 9, 0 => 10 ] => { "1" : 9, "0" : 10 } +]]> + + + + 5 つの例はすべてドキュメントの抜粋であり、ドキュメント内の1 つの値のみを表していることに注意してください。 + + +
+
+ +
+ オブジェクト + + + If an object is of the stdClass class, serialize + as a BSON document. + + + + If an object is a supported class that implements + MongoDB\BSON\Type, then use the BSON + serialization logic for that specific type. + MongoDB\BSON\Type instances (excluding + MongoDB\BSON\Serializable may only be + serialized as a document field value. Attempting to serialize such an + object as a root document will throw a + MongoDB\Driver\Exception\UnexpectedValueException + + + + If an object is of an unknown class implementing the + MongoDB\BSON\Type interface, then throw a + MongoDB\Driver\Exception\UnexpectedValueException + + + + If an object is of any other class, without implementing any special + interface, serialize as a BSON document. Keep only + public properties, and ignore + protected and private + properties. + + + + If an object is of a class that implements the + MongoDB\BSON\Serializable interface, call + MongoDB\BSON\Serializable::bsonSerialize and use + the returned array or stdClass to serialize as a + BSON document or array. The BSON type will be determined by the following: + + + + + + Root documents must be serialized as a BSON + document. + + + + + MongoDB\BSON\Persistable objects must be + serialized as a BSON document. + + + + + If MongoDB\BSON\Serializable::bsonSerialize + returns a packed array, serialize as a BSON array. + + + + + If MongoDB\BSON\Serializable::bsonSerialize + returns a non-packed array or stdClass, + serialize as a BSON document. + + + + + If MongoDB\BSON\Serializable::bsonSerialize + did not return an array or stdClass, throw an + MongoDB\Driver\Exception\UnexpectedValueException + exception. + + + + + + + If an object is of a class that implements the + MongoDB\BSON\Persistable interface (which + implies MongoDB\BSON\Serializable), obtain + the properties in a similar way as in the previous paragraphs, but + also add an additional property + __pclass as a Binary value, with subtype + 0x80 and data bearing the fully qualified class name + of the object that is being serialized. + + + + The __pclass property is added to the array or + object returned by + MongoDB\BSON\Serializable::bsonSerialize, which + means it will overwrite any __pclass key/property in + the MongoDB\BSON\Serializable::bsonSerialize + return value. If you want to avoid this behaviour and set your own + __pclass value, you must not + implement MongoDB\BSON\Persistable and + should instead implement + MongoDB\BSON\Serializable directly. + + +
+ + + + {"foo": 42} + +class MyClass +{ + public $foo = 42; + protected $prot = 'wine'; + private $fpr = 'cheese'; +} // => {"foo": 42} + +class AnotherClass1 implements MongoDB\BSON\Serializable +{ + public $foo = 42; + protected $prot = 'wine'; + private $fpr = 'cheese'; + + public function bsonSerialize(): array + { + return ['foo' => $this->foo, 'prot' => $this->prot]; + } +} // => {"foo": 42, "prot": "wine"} + +class AnotherClass2 implements MongoDB\BSON\Serializable +{ + public $foo = 42; + + public function bsonSerialize(): self + { + return $this; + } +} // => MongoDB\Driver\Exception\UnexpectedValueException("bsonSerialize() did not return an array or stdClass") + +class AnotherClass3 implements MongoDB\BSON\Serializable +{ + private $elements = ['foo', 'bar']; + + public function bsonSerialize(): array + { + return $this->elements; + } +} // => {"0": "foo", "1": "bar"} + +/** + * Nesting Serializable classes + */ + +class AnotherClass4 implements MongoDB\BSON\Serializable +{ + private $elements = [0 => 'foo', 2 => 'bar']; + + public function bsonSerialize(): array + { + return $this->elements; + } +} // => {"0": "foo", "2": "bar"} + +class ContainerClass1 implements MongoDB\BSON\Serializable +{ + public $things; + + public function __construct() + { + $this->things = new AnotherClass4(); + } + + function bsonSerialize(): array + { + return ['things' => $this->things]; + } +} // => {"things": {"0": "foo", "2": "bar"}} + + +class AnotherClass5 implements MongoDB\BSON\Serializable +{ + private $elements = [0 => 'foo', 2 => 'bar']; + + public function bsonSerialize(): array + { + return array_values($this->elements); + } +} // => {"0": "foo", "1": "bar"} as a root class + // ["foo", "bar"] as a nested value + +class ContainerClass2 implements MongoDB\BSON\Serializable +{ + public $things; + + public function __construct() + { + $this->things = new AnotherClass5(); + } + + public function bsonSerialize(): array + { + return ['things' => $this->things]; + } +} // => {"things": ["foo", "bar"]} + + +class AnotherClass6 implements MongoDB\BSON\Serializable +{ + private $elements = ['foo', 'bar']; + + function bsonSerialize(): object + { + return (object) $this->elements; + } +} // => {"0": "foo", "1": "bar"} + +class ContainerClass3 implements MongoDB\BSON\Serializable +{ + public $things; + + public function __construct() + { + $this->things = new AnotherClass6(); + } + + public function bsonSerialize(): array + { + return ['things' => $this->things]; + } +} // => {"things": {"0": "foo", "1": "bar"}} + +class UpperClass implements MongoDB\BSON\Persistable +{ + public $foo = 42; + protected $prot = 'wine'; + private $fpr = 'cheese'; + + private $data; + + public function bsonUnserialize(array $data): void + { + $this->data = $data; + } + + public function bsonSerialize(): array + { + return ['foo' => $this->foo, 'prot' => $this->prot]; + } +} // => {"foo": 42, "prot": "wine", "__pclass": {"$type": "80", "$binary": "VXBwZXJDbGFzcw=="}} + +?> +]]> + +
+
+
+ +
+ BSON からのデシリアライズ + + &mongodb.warning.duplicate-keys; + + + The legacy mongo extension deserialized + both BSON documents and arrays as PHP arrays. While PHP arrays are + convenient to work with, this behavior was problematic because different + BSON types could deserialize to the same PHP value (e.g. + {"0": "foo"} and ["foo"]) and make it + impossible to infer the original BSON type. By default, the + mongodb extension addresses this concern by ensuring that BSON + arrays and documents are converted to PHP arrays and objects, respectively. + + + For compound types, there are three data types: + + + + + + root + + + refers to the top-level BSON document only + + + + + document + + + refers to embedded BSON documents only + + + + + array + + + refers to a BSON array + + + + + + + + Besides the three collective types, it is also possible to configure + specific fields in your document to map to the data types mentioned below. + As an example, the following type map allows you to + map each embedded document within an "addresses" array to + an Address class and each + "city" field within those embedded address documents to + a City class: + + + [ + 'addresses.$' => 'MyProject\Address', + 'addresses.$.city' => 'MyProject\City', + ], +] +]]> + + + + + Each of those three data types, as well as the field specific mappings, + can be mapped against different PHP types. The possible mapping values + are: + + + + + + not set or NULL (default) + + + + + + A BSON array will be deserialized as a PHP array. + + + + + A BSON document (root or embedded) without a + __pclass property + + + A __pclass property is only deemed to exist if + there exists a property with that name, and it is a Binary value, + and the sub-type of the Binary value is 0x80. If any of these three + conditions is not met, the __pclass property does not exist and + should be treated as any other normal property. + + + becomes a PHP stdClass object, with each + BSON document key set as a public stdClass + property. + + + + + A BSON document (root or embedded) with a + __pclass property becomes a PHP object of + the class name as defined by the __pclass + property. + + + If the named class implements the + MongoDB\BSON\Persistable interface, + then the properties of the BSON document, including the + __pclass property, are sent as an associative + array to the + MongoDB\BSON\Unserializable::bsonUnserialize + function to initialise the object's properties. + + + If the named class does not exist or does not implement the + MongoDB\BSON\Persistable interface, + stdClass will be used and each BSON document + key (including __pclass) will be set as a + public stdClass property. + + + The __pclass functionality relies on the + property being part of a retrieved MongoDB document. If you use a + projection + when querying for documents, you need to include the + __pclass field in the projection for this + functionality to work. + + + + + + + + + "array" + + + Turns a BSON array or BSON document into a PHP array. There will be no + special treatment of a __pclass property , + but it may be set as an element in the returned array if it was + present in the BSON document. + + + + + + "object" or "stdClass" + + + Turns a BSON array or BSON document into a + stdClass object. There will be no special + treatment of a __pclass property , but it may + be set as a public property in the returned object if it was present + in the BSON document. + + + + + + "bson" + + + Turns a BSON array into a MongoDB\BSON\PackedArray + and a BSON document into a MongoDB\BSON\Document, + regardless of whether the BSON document has a __pclass + property . + + + + The bson value is only available for the three root + types, not in the field specific mappings. + + + + + + + any other string + + + Defines the class name that the BSON array or BSON object should be + deserialized as. For BSON objects that include + __pclass properties, that class will take + priority. + + + + If the named class does not exist, is not concrete (i.e. it is + abstract or an interface), or does not implement + MongoDB\BSON\Unserializable then an + MongoDB\Driver\Exception\InvalidArgumentException + exception is thrown. + + + + If the BSON object has a __pclass property and + that class exists and implements + MongoDB\BSON\Persistable it will + supersede the class provided in the type map. + + + + The properties of the BSON document, including + the __pclass property if it exists, will be sent + as an associative array to the + MongoDB\BSON\Unserializable::bsonUnserialize + function to initialise the object's properties. + + + + + + +
+ TypeMap + + + TypeMaps can be set through the + MongoDB\Driver\Cursor::setTypeMap method on a + MongoDB\Driver\Cursor object, or the + $typeMap argument of + MongoDB\BSON\toPHP, + MongoDB\BSON\Document::toPHP, and + MongoDB\BSON\PackedArray::toPHP. Each of the three + classes (root, document, and + array) can be individually set, in addition to the + field specific types. + + + + If the value in the map is NULL, it means the same as the + default value for that item. + +
+ +
+ + + + These examples use the following classes: + + + + + + MyClass + + + which does not implement any interface + + + + + YourClass + + + which implements + MongoDB\BSON\Unserializable + + + + + OurClass + + + which implements + MongoDB\BSON\Persistable + + + + + TheirClass + + + which extends OurClass + + + + + + + + The MongoDB\BSON\Unserializable::bsonUnserialize + method of YourClass, OurClass, TheirClass iterate over the array and set + the properties without modifications. It also sets + the $unserialized property to &true;: + + + $value ) + { + $this->$k = $value; + } + $this->unserialized = true; +} +]]> + + + + + + stdClass { $foo => 'yes', $bar => false } + +{ "foo": "no", "array" : [ 5, 6 ] } + -> stdClass { $foo => 'no', $array => [ 5, 6 ] } + +{ "foo": "no", "obj" : { "embedded" : 3.14 } } + -> stdClass { $foo => 'no', $obj => stdClass { $embedded => 3.14 } } + +{ "foo": "yes", "__pclass": "MyClass" } + -> stdClass { $foo => 'yes', $__pclass => 'MyClass' } + +{ "foo": "yes", "__pclass": { "$type" : "80", "$binary" : "MyClass" } } + -> stdClass { $foo => 'yes', $__pclass => Binary(0x80, 'MyClass') } + +{ "foo": "yes", "__pclass": { "$type" : "80", "$binary" : "YourClass") } + -> stdClass { $foo => 'yes', $__pclass => Binary(0x80, 'YourClass') } + +{ "foo": "yes", "__pclass": { "$type" : "80", "$binary" : "OurClass") } + -> OurClass { $foo => 'yes', $__pclass => Binary(0x80, 'OurClass'), $unserialized => true } + +{ "foo": "yes", "__pclass": { "$type" : "44", "$binary" : "YourClass") } + -> stdClass { $foo => 'yes', $__pclass => Binary(0x44, 'YourClass') } +]]> + + + + + + "MissingClass" ] */ +{ "foo": "yes" } + -> MongoDB\Driver\Exception\InvalidArgumentException("MissingClass does not exist") + +/* typemap: [ "root" => "MyClass" ] */ +{ "foo": "yes", "__pclass" : { "$type": "80", "$binary": "MyClass" } } + -> MongoDB\Driver\Exception\InvalidArgumentException("MyClass does not implement Unserializable interface") + +/* typemap: [ "root" => "MongoDB\BSON\Unserializable" ] */ +{ "foo": "yes" } + -> MongoDB\Driver\Exception\InvalidArgumentException("Unserializable is not a concrete class") + +/* typemap: [ "root" => "YourClass" ] */ +{ "foo": "yes", "__pclass" : { "$type": "80", "$binary": "MongoDB\BSON\Unserializable" } } + -> YourClass { $foo => "yes", $__pclass => Binary(0x80, "MongoDB\BSON\Unserializable"), $unserialized => true } + +/* typemap: [ "root" => "YourClass" ] */ +{ "foo": "yes", "__pclass" : { "$type": "80", "$binary": "MyClass" } } + -> YourClass { $foo => "yes", $__pclass => Binary(0x80, "MyClass"), $unserialized => true } + +/* typemap: [ "root" => "YourClass" ] */ +{ "foo": "yes", "__pclass" : { "$type": "80", "$binary": "OurClass" } } + -> OurClass { $foo => "yes", $__pclass => Binary(0x80, "OurClass"), $unserialized => true } + +/* typemap: [ "root" => "YourClass" ] */ +{ "foo": "yes", "__pclass" : { "$type": "80", "$binary": "TheirClass" } } + -> TheirClass { $foo => "yes", $__pclass => Binary(0x80, "TheirClass"), $unserialized => true } + +/* typemap: [ "root" => "OurClass" ] */ +{ foo: "yes", "__pclass" : { "$type": "80", "$binary": "TheirClass" } } + -> TheirClass { $foo => "yes", $__pclass => Binary(0x80, "TheirClass"), $unserialized => true } +]]> + + + + + + 'YourClass' ] */ +{ foo: "yes", "__pclass" : { "$type": "80", "$binary": "YourClass" } } + -> YourClass { $foo => 'yes', $__pclass => Binary(0x80, 'YourClass'), $unserialized => true } +]]> + + + + + + 'array', 'document' => 'array' ] */ +{ "foo": "yes", "bar" : false } + -> [ "foo" => "yes", "bar" => false ] + +{ "foo": "no", "array" : [ 5, 6 ] } + -> [ "foo" => "no", "array" => [ 5, 6 ] ] + +{ "foo": "no", "obj" : { "embedded" : 3.14 } } + -> [ "foo" => "no", "obj" => [ "embedded => 3.14 ] ] + +{ "foo": "yes", "__pclass": "MyClass" } + -> [ "foo" => "yes", "__pclass" => "MyClass" ] + +{ "foo": "yes", "__pclass" : { "$type": "80", "$binary": "MyClass" } } + -> [ "foo" => "yes", "__pclass" => Binary(0x80, "MyClass") ] + +{ "foo": "yes", "__pclass" : { "$type": "80", "$binary": "OurClass" } } + -> [ "foo" => "yes", "__pclass" => Binary(0x80, "OurClass") ] +]]> + + + + + + 'object', 'document' => 'object' ] */ +{ "foo": "yes", "__pclass": { "$type": "80", "$binary": "MyClass" } } + -> stdClass { $foo => "yes", "__pclass" => Binary(0x80, "MyClass") } +]]> + + + +
+
+ +
+
+ + diff --git a/reference/mongodb/book.xml b/reference/mongodb/book.xml new file mode 100644 index 0000000000..6e93fb2c49 --- /dev/null +++ b/reference/mongodb/book.xml @@ -0,0 +1,60 @@ + + + + + + + MongoDB 拡張モジュール + MongoDB + + + + + この拡張モジュールは + libmongoc and + libbson ライブラリの上に開発されています。コアドライバ機能のための最小限の API を提供します: + コマンド, + クエリ, + 書き込み, + 接続管理, + および BSON シリアライズ。 + + + この拡張モジュールに依存するユーザーランド PHP ライブラリは、クエリビルダー、個別のコマンドヘルパーメソッド、GridFS などのより高レベルな API を提供する場合があります。 アプリケーション開発者は、この拡張モジュールを + MongoDB PHP ライブラリと組み合わせて使用することを検討すべきです。このライブラリは、他の言語の MongoDB ドライバに見られるのと同じ高レベル API を実装しています。 この関心の分離により、拡張モジュールはパフォーマンスにとって不可欠な機能に集中することができます。 + + + + + &reference.mongodb.setup; + &reference.mongodb.constants; + &reference.mongodb.tutorial; + &reference.mongodb.architecture; + &reference.mongodb.security; + + &reference.mongodb.mongodb; + &reference.mongodb.bson; + &reference.mongodb.monitoring; + &reference.mongodb.exceptions; + + + diff --git a/reference/mongodb/bson.xml b/reference/mongodb/bson.xml new file mode 100644 index 0000000000..64b586e94f --- /dev/null +++ b/reference/mongodb/bson.xml @@ -0,0 +1,49 @@ + + + + + + + MongoDB BSON クラスと関数 + MongoDB\BSON + + + &Functions; + &reference.mongodb.functions.entities.bson; + + + &reference.mongodb.bson.document; + &reference.mongodb.bson.packedarray; + &reference.mongodb.bson.iterator; + + &reference.mongodb.bson.binary; + &reference.mongodb.bson.vectortype; + &reference.mongodb.bson.decimal128; + &reference.mongodb.bson.javascript; + &reference.mongodb.bson.maxkey; + &reference.mongodb.bson.minkey; + &reference.mongodb.bson.objectid; + &reference.mongodb.bson.regex; + &reference.mongodb.bson.timestamp; + &reference.mongodb.bson.utcdatetime; + + &reference.mongodb.bson.type; + &reference.mongodb.bson.persistable; + &reference.mongodb.bson.serializable; + &reference.mongodb.bson.unserializable; + + &reference.mongodb.bson.binaryinterface; + &reference.mongodb.bson.decimal128interface; + &reference.mongodb.bson.javascriptinterface; + &reference.mongodb.bson.maxkeyinterface; + &reference.mongodb.bson.minkeyinterface; + &reference.mongodb.bson.objectidinterface; + &reference.mongodb.bson.regexinterface; + &reference.mongodb.bson.timestampinterface; + &reference.mongodb.bson.utcdatetimeinterface; + + &reference.mongodb.bson.dbpointer; + &reference.mongodb.bson.int64; + &reference.mongodb.bson.symbol; + &reference.mongodb.bson.undefined; + diff --git a/reference/mongodb/bson/binary.xml b/reference/mongodb/bson/binary.xml new file mode 100644 index 0000000000..2c464f49b5 --- /dev/null +++ b/reference/mongodb/bson/binary.xml @@ -0,0 +1,317 @@ + + + + + + + MongoDB\BSON\Binary クラス + MongoDB\BSON\Binary + + + + +
+ &reftitle.intro; + + バイナリデータ (バイト配列) の BSON 型です。Binary 値にはサブタイプもあり、バイト配列に含まれるデータの種類を示すために使用されます。0 から 127 のサブタイプは事前定義済みまたは予約済みです。128 から 255 のサブタイプはユーザー定義です。 + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Binary + + + + final + + MongoDB\BSON\Binary + + + + MongoDB\BSON\BinaryInterface + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + &Constants; + + const + int + MongoDB\BSON\Binary::TYPE_GENERIC + 0 + + + const + int + MongoDB\BSON\Binary::TYPE_FUNCTION + 1 + + + const + int + MongoDB\BSON\Binary::TYPE_OLD_BINARY + 2 + + + const + int + MongoDB\BSON\Binary::TYPE_OLD_UUID + 3 + + + const + int + MongoDB\BSON\Binary::TYPE_UUID + 4 + + + const + int + MongoDB\BSON\Binary::TYPE_MD5 + 5 + + + const + int + MongoDB\BSON\Binary::TYPE_ENCRYPTED + 6 + + + const + int + MongoDB\BSON\Binary::TYPE_COLUMN + 7 + + + const + int + MongoDB\BSON\Binary::TYPE_SENSITIVE + 8 + + + const + int + MongoDB\BSON\Binary::TYPE_VECTOR + 9 + + + const + int + MongoDB\BSON\Binary::TYPE_USER_DEFINED + 128 + + + &Methods; + + + + +
+ + +
+ &reftitle.constants; + + + + MongoDB\BSON\Binary::TYPE_GENERIC + + 汎用バイナリデータ。 + + + + + MongoDB\BSON\Binary::TYPE_FUNCTION + + 関数。 + + + + + MongoDB\BSON\Binary::TYPE_OLD_BINARY + + Generic binary data (deprecated in favor of MongoDB\BSON\Binary::TYPE_GENERIC). + + + + + MongoDB\BSON\Binary::TYPE_OLD_UUID + + + ユニバーサル一意識別子 ( + MongoDB\BSON\Binary::TYPE_UUID の使用が推奨されます。非推奨)。この型を使用する場合、Binary のデータは 16 バイトの長さである必要があります。 + + + 歴史的に、他のドライバはこの型の値を言語の規約 (例: エンディアンの違い) に基づいてエンコードしていたため、移植性がありません。PHP 拡張モジュールはこの型のデータのエンコードやデコードに特別な処理を適用しません。 + + + + + + MongoDB\BSON\Binary::TYPE_UUID + + + ユニバーサル一意識別子。この型を使用する場合、Binary のデータは 16 バイトの長さで、 + RFC 4122. + + + + + + MongoDB\BSON\Binary::TYPE_MD5 + + MD5 ハッシュ。この型を使用する場合、Binary のデータは 16 バイトの長さである必要があります。 + + + + + MongoDB\BSON\Binary::TYPE_ENCRYPTED + + 暗号化された値。このサブタイプはクライアントサイド暗号化に使用されます。 + + + + + MongoDB\BSON\Binary::TYPE_COLUMN + + カラムデータ。このサブタイプは時系列コレクションに使用されます。 + + + + + MongoDB\BSON\Binary::TYPE_SENSITIVE + + + 機密データ。このサブタイプは、可能な場合にサーバーサイドのログから除外すべき機密データに使用されます。 + + + + + + MongoDB\BSON\Binary::TYPE_VECTOR + + + ベクトルデータ。このサブタイプは、MongoDB のベクトル検索で使用するベクトルデータを効率的に格納するために使用されます。 + + + + + + MongoDB\BSON\Binary::TYPE_USER_DEFINED + + + ユーザー定義型。0 から 127 の型は事前定義済みまたは予約済みですが、128 から 255 の型はユーザー定義であり、何にでも使用できます。 + + + + + +
+ + +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 2.2.0 + + Added MongoDB\BSON\Binary::TYPE_VECTOR, as well as the + MongoDB\BSON\Binary::fromVector, + MongoDB\BSON\Binary::getVectorType, and + MongoDB\BSON\Binary::toArray functions. + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.17.0 + + MongoDB\BSON\Binary::TYPE_SENSITIVE を追加しました。 + + + + PECL mongodb 1.12.0 + + + PHP 8.0 以降で Stringable を実装しました。 + + + MongoDB\BSON\Binary::TYPE_COLUMN を追加しました。 + + + + + PECL mongodb 1.7.0 + + MongoDB\BSON\Binary::TYPE_ENCRYPTED を追加しました。 + + + + PECL mongodb 1.3.0 + + MongoDB\BSON\BinaryInterface を実装しました。 + + + + PECL mongodb 1.2.0 + + Implements Serializable and + JsonSerializable. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.binary; + +
+ + diff --git a/reference/mongodb/bson/binary/construct.xml b/reference/mongodb/bson/binary/construct.xml new file mode 100644 index 0000000000..e76c2e8ae6 --- /dev/null +++ b/reference/mongodb/bson/binary/construct.xml @@ -0,0 +1,156 @@ + + + + + + + MongoDB\BSON\Binary::__construct + 新しい Binary を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\Binary::__construct + stringdata + inttypeMongoDB\BSON\Binary::TYPE_GENERIC + + + + + &reftitle.parameters; + + + data (string) + + + Binary data. + + + + + type (int) + + + データの型を示す符号なし 8 ビット整数。 指定しない場合は MongoDB\BSON\Binary::TYPE_GENERIC がデフォルトになります。 + + + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + type が符号なし 8 ビット整数でない場合に MongoDB\Driver\Exception\InvalidArgumentException をスローします。 + Throws MongoDB\Driver\Exception\InvalidArgumentException if type is MongoDB\BSON\Binary::TYPE_UUID or MongoDB\BSON\Binary::TYPE_OLD_UUID and data is not exactly 16 bytes in length. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 1.15.0 + + + type パラメータは、指定しない場合 MongoDB\BSON\Binary::TYPE_GENERIC がデフォルトになりました。 + + + + + PECL mongodb 1.3.0 + + + MongoDB\Driver\Exception\InvalidArgumentException + is thrown if type is + MongoDB\BSON\Binary::TYPE_UUID or + MongoDB\BSON\Binary::TYPE_OLD_UUID and + data is not exactly 16 bytes in length. + + + + + PECL mongodb 1.1.3 + + + MongoDB\Driver\Exception\InvalidArgumentException + is thrown if type is not an unsigned 8-bit + integer. + + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Binary::__construct</function> の例 + + +]]> + + &example.outputs; + + + string(3) "foo" + ["type"]=> + int(0) +} +]]> + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/binary/fromvector.xml b/reference/mongodb/bson/binary/fromvector.xml new file mode 100644 index 0000000000..353aa6279d --- /dev/null +++ b/reference/mongodb/bson/binary/fromvector.xml @@ -0,0 +1,92 @@ + + + + + + + MongoDB\BSON\Binary::fromVector + 指定された配列とベクトル型からサブタイプ MongoDB\BSON\Binary::SUBTYPE_VECTOR の新しい Binary を作成する + + + + &reftitle.description; + + final public static MongoDB\BSON\BinaryMongoDB\BSON\Binary::fromVector + arrayvector + MongoDB\BSON\VectorTypevectorType + + + + + &reftitle.parameters; + + + vector (array) + + + ベクトルデータを表す値の配列。各値の型は vectorType パラメータが示す型と一致する必要があります: + + for MongoDB\BSON\VectorType::Float32, each value must be a float + for MongoDB\BSON\VectorType::Int8, each value must be an 8-bit int, i.e. from -127 to 128 + for MongoDB\BSON\VectorType::PackedBit, each value must be a bool or 1-bit int, i.e. 0 or 1 + + + + + + vectorType (MongoDB\BSON\VectorType) + + + The vector data type. + + + + + + + + &reftitle.returnvalues; + + Returns a new Binary with subtype MongoDB\BSON\Binary::SUBTYPE_VECTOR. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + MongoDB\BSON\Binary::toArray + MongoDB\BSON\Binary::getVectorType + MongoDB\BSON\VectorType + BSON Types + + + + + + diff --git a/reference/mongodb/bson/binary/getdata.xml b/reference/mongodb/bson/binary/getdata.xml new file mode 100644 index 0000000000..b0d38ee0bb --- /dev/null +++ b/reference/mongodb/bson/binary/getdata.xml @@ -0,0 +1,91 @@ + + + + + + + MongoDB\BSON\Binary::getData + Binary の data を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Binary::getData + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Binary's data. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Binary::getData</function> の例 + +getData()); + +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/binary/gettype.xml b/reference/mongodb/bson/binary/gettype.xml new file mode 100644 index 0000000000..94d954022f --- /dev/null +++ b/reference/mongodb/bson/binary/gettype.xml @@ -0,0 +1,91 @@ + + + + + + + MongoDB\BSON\Binary::getType + Binary の type を返す + + + + &reftitle.description; + + final public intMongoDB\BSON\Binary::getType + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Binary's type. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Binary::getType</function> の例 + +getType()); + +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/binary/getvectortype.xml b/reference/mongodb/bson/binary/getvectortype.xml new file mode 100644 index 0000000000..0766b745f4 --- /dev/null +++ b/reference/mongodb/bson/binary/getvectortype.xml @@ -0,0 +1,68 @@ + + + + + + + MongoDB\BSON\Binary::getVectorType + data type for a Binary with the vector subtype を返す + + + + &reftitle.description; + + final public MongoDB\BSON\VectorTypeMongoDB\BSON\Binary::getVectorType + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the data type of the Binary vector. + + + + + &reftitle.errors; + + Throws MongoDB\Driver\Exception\LogicException if the subtype is not MongoDB\BSON\Binary::SUBTYPE_VECTOR. + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + BSON Types + MongoDB\BSON\VectorType + + + + + + diff --git a/reference/mongodb/bson/binary/jsonserialize.xml b/reference/mongodb/bson/binary/jsonserialize.xml new file mode 100644 index 0000000000..b58cd090eb --- /dev/null +++ b/reference/mongodb/bson/binary/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\Binary::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\Binary::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\Binary. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/binary/toarray.xml b/reference/mongodb/bson/binary/toarray.xml new file mode 100644 index 0000000000..d493609e97 --- /dev/null +++ b/reference/mongodb/bson/binary/toarray.xml @@ -0,0 +1,68 @@ + + + + + + + MongoDB\BSON\Binary::toArray + サブタイプ MongoDB\BSON\Binary::SUBTYPE_VECTOR の Binary のベクトルを配列として返す + + + + &reftitle.description; + + final public arrayMongoDB\BSON\Binary::toArray + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + ベクトルデータを含む配列を返します。 + + + + + &reftitle.errors; + + サブタイプが MongoDB\BSON\Binary::SUBTYPE_VECTOR でない場合に MongoDB\Driver\Exception\LogicException をスローします。 + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + MongoDB\BSON\Binary::fromVector + BSON Types + + + + + + diff --git a/reference/mongodb/bson/binary/tostring.xml b/reference/mongodb/bson/binary/tostring.xml new file mode 100644 index 0000000000..4415735375 --- /dev/null +++ b/reference/mongodb/bson/binary/tostring.xml @@ -0,0 +1,86 @@ + + + + + + + MongoDB\BSON\Binary::__toString + Binary の data を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Binary::__toString + + + + &info.method.alias; MongoDB\BSON\Binary::getData. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Binary's data. + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Binary::__toString</function> の例 + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Binary::getData + BSON Types + + + + + + diff --git a/reference/mongodb/bson/binaryinterface.xml b/reference/mongodb/bson/binaryinterface.xml new file mode 100644 index 0000000000..fa19bb6ccf --- /dev/null +++ b/reference/mongodb/bson/binaryinterface.xml @@ -0,0 +1,77 @@ + + + + + + + MongoDB\BSON\BinaryInterface インターフェイス + MongoDB\BSON\BinaryInterface + + +
+ &reftitle.intro; + + This interface is implemented by MongoDB\BSON\Binary + to be used as a parameter, return, or property type in userland classes. + +
+ +
+ &reftitle.classsynopsis; + + MongoDB\BSON\BinaryInterface + + + MongoDB\BSON\BinaryInterface + + + &Methods; + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + &mongodb.changelog.tentative-return-types; + + + + +
+
+ + &reference.mongodb.bson.entities.binaryinterface; + +
+ + diff --git a/reference/mongodb/bson/binaryinterface/getdata.xml b/reference/mongodb/bson/binaryinterface/getdata.xml new file mode 100644 index 0000000000..d99f91916d --- /dev/null +++ b/reference/mongodb/bson/binaryinterface/getdata.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\BinaryInterface::getData + BinaryInterface の data を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\BinaryInterface::getData + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the BinaryInterface's data. + + + + + &reftitle.seealso; + + MongoDB\BSON\Binary::getData + + + + + + diff --git a/reference/mongodb/bson/binaryinterface/gettype.xml b/reference/mongodb/bson/binaryinterface/gettype.xml new file mode 100644 index 0000000000..129baa3a9f --- /dev/null +++ b/reference/mongodb/bson/binaryinterface/gettype.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\BinaryInterface::getType + BinaryInterface の type を返す + + + + &reftitle.description; + + abstract public intMongoDB\BSON\BinaryInterface::getType + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the BinaryInterface's type. + + + + + &reftitle.seealso; + + MongoDB\BSON\Binary::getType + + + + + + diff --git a/reference/mongodb/bson/binaryinterface/tostring.xml b/reference/mongodb/bson/binaryinterface/tostring.xml new file mode 100644 index 0000000000..6e0da0232f --- /dev/null +++ b/reference/mongodb/bson/binaryinterface/tostring.xml @@ -0,0 +1,63 @@ + + + + + + + MongoDB\BSON\BinaryInterface::__toString + BinaryInterface の data を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\BinaryInterface::__toString + + + + &info.method.alias; MongoDB\BSON\BinaryInterface::getData. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the BinaryInterface's data. + + + + + &reftitle.seealso; + + MongoDB\BSON\BinaryInterface::getData + MongoDB\BSON\Binary::__toString + + + + + + diff --git a/reference/mongodb/bson/dbpointer.xml b/reference/mongodb/bson/dbpointer.xml new file mode 100644 index 0000000000..f8572707fb --- /dev/null +++ b/reference/mongodb/bson/dbpointer.xml @@ -0,0 +1,109 @@ + + + + + + + MongoDB\BSON\DBPointer クラス + MongoDB\BSON\DBPointer + + + + +
+ &reftitle.intro; + + BSON type for the "DBPointer" type. This BSON type is deprecated, and this + class can not be instantiated. It will be created from a BSON DBPointer + type while converting BSON to PHP, and can also be converted back into + BSON while storing documents in the database. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\DBPointer + + + + final + + MongoDB\BSON\DBPointer + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.dbpointer; + +
+ + diff --git a/reference/mongodb/bson/dbpointer/construct.xml b/reference/mongodb/bson/dbpointer/construct.xml new file mode 100644 index 0000000000..808a683973 --- /dev/null +++ b/reference/mongodb/bson/dbpointer/construct.xml @@ -0,0 +1,56 @@ + + + + + + + MongoDB\BSON\DBPointer::__construct + 新しい DBPointer (unused) を作成する + + + + &reftitle.description; + + final private MongoDB\BSON\DBPointer::__construct + + + + MongoDB\BSON\DBPointer objects are created through + conversion from a deprecated BSON type and cannot be constructed directly. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/dbpointer/jsonserialize.xml b/reference/mongodb/bson/dbpointer/jsonserialize.xml new file mode 100644 index 0000000000..ae95737315 --- /dev/null +++ b/reference/mongodb/bson/dbpointer/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\DBPointer::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\DBPointer::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\DBPointer. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/dbpointer/tostring.xml b/reference/mongodb/bson/dbpointer/tostring.xml new file mode 100644 index 0000000000..82f0c99b30 --- /dev/null +++ b/reference/mongodb/bson/dbpointer/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\DBPointer::__toString + empty string を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\DBPointer::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns an empty string. + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/decimal128.xml b/reference/mongodb/bson/decimal128.xml new file mode 100644 index 0000000000..cec51ff456 --- /dev/null +++ b/reference/mongodb/bson/decimal128.xml @@ -0,0 +1,134 @@ + + + + + + + MongoDB\BSON\Decimal128 クラス + MongoDB\BSON\Decimal128 + + + + +
+ &reftitle.intro; + + BSON type for the + Decimal128 floating-point format, + which supports numbers with up to 34 decimal digits (i.e. significant + digits) and an exponent range of −6143 to +6144. + + + Unlike the double BSON type (i.e. float in PHP), which only + stores an approximation of the decimal values, the decimal data type stores + the exact value. For example, MongoDB\BSON\Decimal128('9.99') + has a precise value of 9.99 where as a double 9.99 would have an approximate + value of 9.9900000000000002131628…. + + &mongodb.note.decimal128; +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Decimal128 + + + + final + + MongoDB\BSON\Decimal128 + + + + MongoDB\BSON\Decimal128Interface + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + PECL mongodb 1.3.0 + + MongoDB\BSON\Decimal128Interface を実装しました。 + + + + PECL mongodb 1.2.0 + + Implements Serializable and + JsonSerializable. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.decimal128; + +
+ + diff --git a/reference/mongodb/bson/decimal128/construct.xml b/reference/mongodb/bson/decimal128/construct.xml new file mode 100644 index 0000000000..b95d5a9986 --- /dev/null +++ b/reference/mongodb/bson/decimal128/construct.xml @@ -0,0 +1,109 @@ + + + + + + + MongoDB\BSON\Decimal128::__construct + 新しい Decimal128 を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\Decimal128::__construct + stringvalue + + &mongodb.note.decimal128; + + + + &reftitle.parameters; + + + value (string) + + + A decimal string. + + + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\InvalidArgumentException if value is not a valid decimal string. + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Decimal128::__construct</function> の例 + + +]]> + + &example.outputs.similar; + + + string(9) "1234.5678" +} +object(MongoDB\BSON\Decimal128)#1 (1) { + ["dec"]=> + string(3) "NaN" +} +object(MongoDB\BSON\Decimal128)#1 (1) { + ["dec"]=> + string(8) "Infinity" +} + +]]> + + + + + + + &reftitle.seealso; + + Decimal128 floating-point format + BSON Types + + + + + + diff --git a/reference/mongodb/bson/decimal128/jsonserialize.xml b/reference/mongodb/bson/decimal128/jsonserialize.xml new file mode 100644 index 0000000000..baede14bfb --- /dev/null +++ b/reference/mongodb/bson/decimal128/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\Decimal128::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\Decimal128::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\Decimal128. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/decimal128/tostring.xml b/reference/mongodb/bson/decimal128/tostring.xml new file mode 100644 index 0000000000..092ff99463 --- /dev/null +++ b/reference/mongodb/bson/decimal128/tostring.xml @@ -0,0 +1,87 @@ + + + + + + + MongoDB\BSON\Decimal128::__toString + string representation of this Decimal128 を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Decimal128::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this Decimal128. + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Decimal128::__toString</function> の例 + + +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + Decimal128 floating-point format + BSON Types + + + + + + diff --git a/reference/mongodb/bson/decimal128interface.xml b/reference/mongodb/bson/decimal128interface.xml new file mode 100644 index 0000000000..1d1468ab0d --- /dev/null +++ b/reference/mongodb/bson/decimal128interface.xml @@ -0,0 +1,77 @@ + + + + + + + MongoDB\BSON\Decimal128Interface インターフェイス + MongoDB\BSON\Decimal128Interface + + +
+ &reftitle.intro; + + This interface is implemented by + MongoDB\BSON\Decimal128 to be used as a parameter, + return, or property type in userland classes. + +
+ +
+ &reftitle.classsynopsis; + + MongoDB\BSON\Decimal128Interface + + + MongoDB\BSON\Decimal128Interface + + + &Methods; + + +
+
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + &mongodb.changelog.tentative-return-types; + + + + +
+
+ + &reference.mongodb.bson.entities.decimal128interface; + +
+ + diff --git a/reference/mongodb/bson/decimal128interface/tostring.xml b/reference/mongodb/bson/decimal128interface/tostring.xml new file mode 100644 index 0000000000..c5396c9569 --- /dev/null +++ b/reference/mongodb/bson/decimal128interface/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\Decimal128Interface::__toString + string representation of this Decimal128Interface を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\Decimal128Interface::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this Decimal128Interface. + + + + + &reftitle.seealso; + + MongoDB\BSON\Decimal128::__toString + + + + + + diff --git a/reference/mongodb/bson/document.xml b/reference/mongodb/bson/document.xml new file mode 100644 index 0000000000..779f0aae2d --- /dev/null +++ b/reference/mongodb/bson/document.xml @@ -0,0 +1,107 @@ + + + + + + + MongoDB\BSON\Document クラス + MongoDB\BSON\Document + + + + +
+ &reftitle.intro; + + Represents a BSON document. This class is used when reading data as raw BSON + and cannot be modified. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Document + + + + final + + MongoDB\BSON\Document + + + + MongoDB\BSON\Type + + + + ArrayAccess + + + + IteratorAggregate + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.17.0 + + MongoDB\BSON\Type を実装しました。 + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.document; + +
+ + diff --git a/reference/mongodb/bson/document/construct.xml b/reference/mongodb/bson/document/construct.xml new file mode 100644 index 0000000000..d21103f442 --- /dev/null +++ b/reference/mongodb/bson/document/construct.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\Document::__construct + 新しい BSON document (unused) を作成する + + + + &reftitle.description; + + final private MongoDB\BSON\Document::__construct + + + + MongoDB\BSON\Document objects are created through + static factory methods and cannot be instantiated directly. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromPHP + MongoDB\BSON\Document::fromBSON + MongoDB\BSON\Document::fromJSON + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/frombson.xml b/reference/mongodb/bson/document/frombson.xml new file mode 100644 index 0000000000..f9ff0b8875 --- /dev/null +++ b/reference/mongodb/bson/document/frombson.xml @@ -0,0 +1,78 @@ + + + + + + + MongoDB\BSON\Document::fromBSON + 新しい document instance from a BSON string を作成する + + + + &reftitle.description; + + final static public MongoDB\BSON\DocumentMongoDB\BSON\Document::fromBSON + stringbson + + + + + &reftitle.parameters; + + + bson (string) + + + A string containing a document in BSON format. + + + + + + + + &reftitle.returnvalues; + + Returns a new MongoDB\BSON\Document instance. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\UnexpectedValueException if bson is an invalid BSON string or contains more than a single document. + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromPHP + MongoDB\BSON\Document::fromJSON + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/fromjson.xml b/reference/mongodb/bson/document/fromjson.xml new file mode 100644 index 0000000000..f8751dc094 --- /dev/null +++ b/reference/mongodb/bson/document/fromjson.xml @@ -0,0 +1,89 @@ + + + + + + + MongoDB\BSON\Document::fromJSON + 新しい document instance from a JSON string を作成する + + + + &reftitle.description; + + final static public MongoDB\BSON\DocumentMongoDB\BSON\Document::fromJSON + stringjson + + + Converts an + extended JSON + string to its BSON representation. + + + + + &reftitle.parameters; + + + json (string) + + + JSON value to be converted. + + + + + + + + &reftitle.returnvalues; + + Returns a new MongoDB\BSON\Document instance. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + Throws + MongoDB\Driver\Exception\UnexpectedValueException if + the JSON value cannot be converted to a BSON document (e.g. due to a syntax + error). + + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromPHP + MongoDB\BSON\Document::fromBSON + MongoDB Extended JSON + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/fromphp.xml b/reference/mongodb/bson/document/fromphp.xml new file mode 100644 index 0000000000..4eaee80192 --- /dev/null +++ b/reference/mongodb/bson/document/fromphp.xml @@ -0,0 +1,79 @@ + + + + + + + MongoDB\BSON\Document::fromPHP + 新しい document instance from PHP data を作成する + + + + &reftitle.description; + + final static public MongoDB\BSON\DocumentMongoDB\BSON\Document::fromPHP + objectarrayvalue + + + + + &reftitle.parameters; + + + value (objectarray) + + + A PHP object or array containing the document. When passing an array with + numeric keys, the numeric values are converted to strings and used as + document keys. + + + + + + + + &reftitle.returnvalues; + + Returns a new MongoDB\BSON\Document instance. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromBSON + MongoDB\BSON\Document::fromJSON + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/get.xml b/reference/mongodb/bson/document/get.xml new file mode 100644 index 0000000000..f00abf42ad --- /dev/null +++ b/reference/mongodb/bson/document/get.xml @@ -0,0 +1,85 @@ + + + + + + + MongoDB\BSON\Document::get + value of a key in the document を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\Document::get + stringkey + + + + + &reftitle.parameters; + + + key (string) + + + The key to retrieve from the document. + + + + + + + + &reftitle.returnvalues; + + Returns the value associated with the given key. If the key is not present in + the document, an exception is thrown. + + + + When encountering a value encoded as 64-bit integer in the BSON document, + the return value of this method will be a + MongoDB\BSON\Int64 instance. + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\RuntimeException if the key is not present in the document. + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::has + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/getiterator.xml b/reference/mongodb/bson/document/getiterator.xml new file mode 100644 index 0000000000..3c99dbbf2a --- /dev/null +++ b/reference/mongodb/bson/document/getiterator.xml @@ -0,0 +1,68 @@ + + + + + + + MongoDB\BSON\Document::getIterator + iterator for the BSON document を返す + + + + &reftitle.description; + + final public MongoDB\BSON\IteratorMongoDB\BSON\Document::getIterator + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a MongoDB\BSON\Iterator instance that can be + used to iterate over all keys in the document. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\UnexpectedValueException if the BSON iterator could not be initialized. + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/has.xml b/reference/mongodb/bson/document/has.xml new file mode 100644 index 0000000000..ac00a6fa0f --- /dev/null +++ b/reference/mongodb/bson/document/has.xml @@ -0,0 +1,76 @@ + + + + + + + MongoDB\BSON\Document::has + a key is present in the document かどうかを返す + + + + &reftitle.description; + + final public boolMongoDB\BSON\Document::has + stringkey + + + + + &reftitle.parameters; + + + key (string) + + + The key to look for in the document. + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the key is present in the document and &false; otherwise. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::get + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/offsetexists.xml b/reference/mongodb/bson/document/offsetexists.xml new file mode 100644 index 0000000000..b79a2d3615 --- /dev/null +++ b/reference/mongodb/bson/document/offsetexists.xml @@ -0,0 +1,70 @@ + + + + + + MongoDB\BSON\Document::offsetExists + a key is present in the document かどうかを返す + + + &reftitle.description; + + final public boolMongoDB\BSON\Document::offsetExists + mixedkey + + + + + &reftitle.parameters; + + + + key + + + The key to look for in the document. + + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the key is present in the document and &false; otherwise. + + + + + &reftitle.seealso; + + + ArrayAccess::offsetExists + MongoDB\BSON\Document::has + + + + + + diff --git a/reference/mongodb/bson/document/offsetget.xml b/reference/mongodb/bson/document/offsetget.xml new file mode 100644 index 0000000000..90162dbdfe --- /dev/null +++ b/reference/mongodb/bson/document/offsetget.xml @@ -0,0 +1,86 @@ + + + + + + MongoDB\BSON\Document::offsetGet + value of a key in the document を返す + + + &reftitle.description; + + final public mixedMongoDB\BSON\Document::offsetGet + mixedkey + + + + + &reftitle.parameters; + + + + key + + + The key to retrieve from the document. + + + + + + + + + &reftitle.returnvalues; + + Returns the value associated with the given key. If the key is not present in + the document, an exception is thrown. + + + + When encountering a value encoded as 64-bit integer in the BSON document, + the return value of this method will be a + MongoDB\BSON\Int64 instance. + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\RuntimeException if the key is not present in the document. + + + + + &reftitle.seealso; + + + ArrayAccess::offsetGet + MongoDB\BSON\Document::get + + + + + + diff --git a/reference/mongodb/bson/document/offsetset.xml b/reference/mongodb/bson/document/offsetset.xml new file mode 100644 index 0000000000..2ac8dd4ffd --- /dev/null +++ b/reference/mongodb/bson/document/offsetset.xml @@ -0,0 +1,80 @@ + + + + + + MongoDB\BSON\Document::offsetSet + ArrayAccess の実装 + + + &reftitle.description; + + final public voidMongoDB\BSON\Document::offsetSet + mixedkey + mixedvalue + + + + 指定された key の値を value に設定します。 + + + + + &reftitle.parameters; + + + + key + + + 設定するインデックス。 + + + + + value + + + key の新しい値。 + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + 常に MongoDB\Driver\Exception\LogicException をスローします。 + + + + + diff --git a/reference/mongodb/bson/document/offsetunset.xml b/reference/mongodb/bson/document/offsetunset.xml new file mode 100644 index 0000000000..28ee3ca837 --- /dev/null +++ b/reference/mongodb/bson/document/offsetunset.xml @@ -0,0 +1,70 @@ + + + + + + MongoDB\BSON\Document::offsetUnset + ArrayAccess の実装 + + + &reftitle.description; + + final public voidMongoDB\BSON\Document::offsetUnset + mixedkey + + + Unsets the value at the specified index. + + + + + &reftitle.parameters; + + + + key + + + 解除するインデックス。 + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + 常に MongoDB\Driver\Exception\LogicException をスローします。 + + + + + diff --git a/reference/mongodb/bson/document/tocanonicalextendedjson.xml b/reference/mongodb/bson/document/tocanonicalextendedjson.xml new file mode 100644 index 0000000000..c0e1c21582 --- /dev/null +++ b/reference/mongodb/bson/document/tocanonicalextendedjson.xml @@ -0,0 +1,142 @@ + + + + + + + MongoDB\BSON\Document::toCanonicalExtendedJSON + Canonical Extended JSON representation of the BSON document を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Document::toCanonicalExtendedJSON + + + + Converts the BSON document to its + Canonical Extended JSON + representation. The canonical format prefers type fidelity at the expense of + concise output and is most suited for producing output that can be converted + back to BSON without any loss of type information (e.g. numeric types will + remain differentiated). + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a string containing the + Canonical Extended JSON + representation of the BSON document. + + + + + &reftitle.examples; + + <methodname>MongoDB\BSON\Document::toCanonicalExtendedJSON</methodname> の例 + + null ], + [ 'boolean' => true ], + [ 'string' => 'foo' ], + [ 'int32' => 123 ], + [ 'int64' => 4294967295 ], + [ 'double' => 1.0 ], + [ 'nan' => NAN ], + [ 'pos_inf' => INF ], + [ 'neg_inf' => -INF ], + [ 'array' => [ 'foo', 'bar' ]], + [ 'document' => [ 'foo' => 'bar' ]], + [ 'oid' => new MongoDB\BSON\ObjectId('56315a7c6118fd1b920270b1') ], + [ 'dec128' => new MongoDB\BSON\Decimal128('1234.5678') ], + [ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ], + [ 'date' => new MongoDB\BSON\UTCDateTime(1445990400000) ], + [ 'timestamp' => new MongoDB\BSON\Timestamp(1234, 5678) ], + [ 'regex' => new MongoDB\BSON\Regex('pattern', 'i') ], + [ 'code' => new MongoDB\BSON\Javascript('function() { return 1; }') ], + [ 'code_ws' => new MongoDB\BSON\Javascript('function() { return a; }', ['a' => 1]) ], + [ 'minkey' => new MongoDB\BSON\MinKey ], + [ 'maxkey' => new MongoDB\BSON\MaxKey ], +]; + +foreach ($documents as $document) { + $bson = MongoDB\BSON\Document::fromPHP($document); + echo $bson->toCanonicalExtendedJSON(), "\n"; +} + +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromJSON + MongoDB\BSON\Document::toRelaxedExtendedJSON + MongoDB\BSON\toCanonicalExtendedJSON + Extended JSON Specification + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/tophp.xml b/reference/mongodb/bson/document/tophp.xml new file mode 100644 index 0000000000..6e698db635 --- /dev/null +++ b/reference/mongodb/bson/document/tophp.xml @@ -0,0 +1,87 @@ + + + + + + + MongoDB\BSON\Document::toPHP + PHP representation of the BSON document を返す + + + + &reftitle.description; + + final public arrayobjectMongoDB\BSON\Document::toPHP + arraynulltypeMap&null; + + + Unserializes the BSON document to its PHP representation. The + typeMap paramater may be used to control the PHP types + used for converting BSON arrays and documents (both root and embedded). + + &mongodb.warning.duplicate-keys; + + + + &reftitle.parameters; + + &mongodb.parameter.typeMap; + + + + + &reftitle.returnvalues; + + The decoded PHP value. + + + + When encountering a value encoded as 64-bit integer in the BSON document, + the return value of this method will be a + MongoDB\BSON\Int64 instance. + + + + + + &reftitle.errors; + + + Throws + MongoDB\Driver\Exception\InvalidArgumentException if + a class in the type map cannot be instantiated or does not implement + MongoDB\BSON\Unserializable. + + + + + + &reftitle.seealso; + + MongoDB\BSON\toPHP + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/torelaxedextendedjson.xml b/reference/mongodb/bson/document/torelaxedextendedjson.xml new file mode 100644 index 0000000000..6d5135c6e0 --- /dev/null +++ b/reference/mongodb/bson/document/torelaxedextendedjson.xml @@ -0,0 +1,141 @@ + + + + + + + MongoDB\BSON\Document::toRelaxedExtendedJSON + Relaxed Extended JSON representation of the BSON document を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Document::toRelaxedExtendedJSON + + + + Converts the BSON document to its + Relaxed Extended JSON + representation. The relaxed format prefers use of JSON type primitives at the + expense of type fidelity and is most suited for producing output that can be + easily consumed by web APIs and humans. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a string containing the + Relaxed Extended JSON + representation of the BSON document. + + + + + &reftitle.examples; + + <methodname>MongoDB\BSON\Document::toRelaxedExtendedJSON</methodname> の例 + + null ], + [ 'boolean' => true ], + [ 'string' => 'foo' ], + [ 'int32' => 123 ], + [ 'int64' => 4294967295 ], + [ 'double' => 1.0 ], + [ 'nan' => NAN ], + [ 'pos_inf' => INF ], + [ 'neg_inf' => -INF ], + [ 'array' => [ 'foo', 'bar' ]], + [ 'document' => [ 'foo' => 'bar' ]], + [ 'oid' => new MongoDB\BSON\ObjectId('56315a7c6118fd1b920270b1') ], + [ 'dec128' => new MongoDB\BSON\Decimal128('1234.5678') ], + [ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ], + [ 'date' => new MongoDB\BSON\UTCDateTime(1445990400000) ], + [ 'timestamp' => new MongoDB\BSON\Timestamp(1234, 5678) ], + [ 'regex' => new MongoDB\BSON\Regex('pattern', 'i') ], + [ 'code' => new MongoDB\BSON\Javascript('function() { return 1; }') ], + [ 'code_ws' => new MongoDB\BSON\Javascript('function() { return a; }', ['a' => 1]) ], + [ 'minkey' => new MongoDB\BSON\MinKey ], + [ 'maxkey' => new MongoDB\BSON\MaxKey ], +]; + +foreach ($documents as $document) { + $bson = MongoDB\BSON\Document::fromPHP($document); + echo $bson->toRelaxedExtendedJSON(), "\n"; +} + +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromJSON + MongoDB\BSON\Document::toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + Extended JSON Specification + BSON Types + + + + + + diff --git a/reference/mongodb/bson/document/tostring.xml b/reference/mongodb/bson/document/tostring.xml new file mode 100644 index 0000000000..8e38aec07c --- /dev/null +++ b/reference/mongodb/bson/document/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\Document::__toString + string representation of this BSON Document を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Document::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this document as BSON. + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/int64.xml b/reference/mongodb/bson/int64.xml new file mode 100644 index 0000000000..5e6e353124 --- /dev/null +++ b/reference/mongodb/bson/int64.xml @@ -0,0 +1,132 @@ + + + + + + + MongoDB\BSON\Int64 クラス + MongoDB\BSON\Int64 + + + + +
+ &reftitle.intro; + + BSON type for a 64-bit integer. When decoding BSON to PHP data, this class + is used when a 64-bit integer cannot be represented as a PHP integer on + 32-bit platforms. These objects support overloaded + arithmetic, + bitwise, and + comparison operators. + + + When working with raw BSON data through the + MongoDB\BSON\Document, + MongoDB\BSON\PackedArray, and + MongoDB\BSON\Iterator classes, any 64-bit integer + will be returned as an instance of this class, regardless of platform and + whether the value can be represented as a PHP integer. This ensures that + values can be roundtripped without changing the type. + + + During BSON encoding, objects of this class will convert back to a 64-bit + integer type, even when the value would fit in a 32-bit integer. This + allows explicitly storing values as 64-bit integers in BSON. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Int64 + + + + final + + MongoDB\BSON\Int64 + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.16.0 + + The class can now be instantiated on all platforms. Added support for + overloaded arithmetic, bitwise, and comparison operators. + + + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.int64; + +
+ + diff --git a/reference/mongodb/bson/int64/construct.xml b/reference/mongodb/bson/int64/construct.xml new file mode 100644 index 0000000000..f27bf3057e --- /dev/null +++ b/reference/mongodb/bson/int64/construct.xml @@ -0,0 +1,102 @@ + + + + + + + MongoDB\BSON\Int64::__construct + 新しい Int64 を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\Int64::__construct + intstringvalue + + + Creates a new MongoDB\BSON\Int64 instance for the + given integer value. + + + + + &reftitle.parameters; + + + value (intstring) + + + The value to assign to the Int64 instance. This + value can be provided as an int or string, the + latter being required on 32-bit platforms to represent 64-bit values. + + + + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 1.16.0 + + + This method was made public to support creating Int64 instances when + working with raw BSON. + + + + + + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\InvalidArgumentException if string value cannot be parsed as a 64-bit integer. + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/int64/jsonserialize.xml b/reference/mongodb/bson/int64/jsonserialize.xml new file mode 100644 index 0000000000..db85175d0b --- /dev/null +++ b/reference/mongodb/bson/int64/jsonserialize.xml @@ -0,0 +1,84 @@ + + + + + + + MongoDB\BSON\Int64::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\Int64::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\Int64. + + + + The output is consistent with the + MongoDB\BSON\toCanonicalExtendedJSON function, which + uses the + canonical + extended JSON format. This differs from other BSON classes, which use the + driver-specific legacy extended JSON format + (MongoDB\BSON\toJSON), in order to ensure that the + 64-bit integer value is correctly represented on 32-bit platforms. + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/int64/tostring.xml b/reference/mongodb/bson/int64/tostring.xml new file mode 100644 index 0000000000..d440b32be9 --- /dev/null +++ b/reference/mongodb/bson/int64/tostring.xml @@ -0,0 +1,84 @@ + + + + + + + MongoDB\BSON\Int64::__toString + string representation of this Int64 を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Int64::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this Int64. + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Int64::__toString</function> の例 + + +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/iterator.xml b/reference/mongodb/bson/iterator.xml new file mode 100644 index 0000000000..eaf68d1029 --- /dev/null +++ b/reference/mongodb/bson/iterator.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\Iterator クラス + MongoDB\BSON\Iterator + + + + +
+ &reftitle.intro; + + Iterator used to iterate a BSON document or array. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Iterator + + + + final + + MongoDB\BSON\Iterator + + + + Iterator + + + + + &Methods; + + + + +
+ +
+ + &reference.mongodb.bson.entities.iterator; + +
+ + diff --git a/reference/mongodb/bson/iterator/construct.xml b/reference/mongodb/bson/iterator/construct.xml new file mode 100644 index 0000000000..8cf2330ee4 --- /dev/null +++ b/reference/mongodb/bson/iterator/construct.xml @@ -0,0 +1,60 @@ + + + + + + + MongoDB\BSON\Iterator::__construct + 新しい BSON iterator (unused) を作成する + + + + &reftitle.description; + + final private MongoDB\BSON\Iterator::__construct + + + + MongoDB\BSON\Iterator objects are created by calling + MongoDB\BSON\Document::getIterator or + MongoDB\BSON\PackedArray::getIterator and cannot be + instantiated directly. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + MongoDB\BSON\Document::getIterator + MongoDB\BSON\PackedArray::getIterator + BSON Types + + + + + + diff --git a/reference/mongodb/bson/iterator/current.xml b/reference/mongodb/bson/iterator/current.xml new file mode 100644 index 0000000000..aaac4029f3 --- /dev/null +++ b/reference/mongodb/bson/iterator/current.xml @@ -0,0 +1,71 @@ + + + + + + + MongoDB\BSON\Iterator::current + current element を返す + + + + &reftitle.description; + + public mixedMongoDB\BSON\Iterator::current + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the value of the current element. + + + + When encountering a value encoded as 64-bit integer in the BSON structure, + the return value of this method will be a + MongoDB\BSON\Int64 instance. + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\LogicException if the iterator is not valid. + + + + + &reftitle.seealso; + + Iterator::current + + + + diff --git a/reference/mongodb/bson/iterator/key.xml b/reference/mongodb/bson/iterator/key.xml new file mode 100644 index 0000000000..c5eac5887c --- /dev/null +++ b/reference/mongodb/bson/iterator/key.xml @@ -0,0 +1,66 @@ + + + + + + + MongoDB\BSON\Iterator::key + key of the current element を返す + + + + &reftitle.description; + + public stringintMongoDB\BSON\Iterator::key + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the key of the current element. When iterating a BSON document, the + key will always be a string. When iterating a BSON array, the + key will be an int. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\LogicException if the iterator is not valid. + + + + + &reftitle.seealso; + + Iterator::key + + + + diff --git a/reference/mongodb/bson/iterator/next.xml b/reference/mongodb/bson/iterator/next.xml new file mode 100644 index 0000000000..aab72837b4 --- /dev/null +++ b/reference/mongodb/bson/iterator/next.xml @@ -0,0 +1,49 @@ + + + + + + + MongoDB\BSON\Iterator::next + イテレータを次の要素に進める + + + + &reftitle.description; + + public voidMongoDB\BSON\Iterator::next + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + Iterator::next + + + + diff --git a/reference/mongodb/bson/iterator/rewind.xml b/reference/mongodb/bson/iterator/rewind.xml new file mode 100644 index 0000000000..7c70ca0008 --- /dev/null +++ b/reference/mongodb/bson/iterator/rewind.xml @@ -0,0 +1,49 @@ + + + + + + + MongoDB\BSON\Iterator::rewind + イテレータを最初の要素に巻き戻す + + + + &reftitle.description; + + public voidMongoDB\BSON\Iterator::rewind + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + Iterator::rewind + + + + diff --git a/reference/mongodb/bson/iterator/valid.xml b/reference/mongodb/bson/iterator/valid.xml new file mode 100644 index 0000000000..268c35a057 --- /dev/null +++ b/reference/mongodb/bson/iterator/valid.xml @@ -0,0 +1,56 @@ + + + + + + + MongoDB\BSON\Iterator::valid + current position is valid かどうかを調べる + + + + &reftitle.description; + + public boolMongoDB\BSON\Iterator::valid + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns &true; if the current iterator position is valid, &false; otherwise. + + + + + &reftitle.seealso; + + Iterator::valid + + + + diff --git a/reference/mongodb/bson/javascript.xml b/reference/mongodb/bson/javascript.xml new file mode 100644 index 0000000000..46bacf0f2d --- /dev/null +++ b/reference/mongodb/bson/javascript.xml @@ -0,0 +1,132 @@ + + + + + + + MongoDB\BSON\Javascript クラス + MongoDB\BSON\Javascript + + + + +
+ &reftitle.intro; + + BSON type for Javascript code. An optional scope document may be specified + that maps identifiers to values and defines the scope in which the code + should be evaluated by the server. + + + + This BSON type is mainly used when executing database commands that take a + Javascript function as a parameter, such as + mapReduce. + + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Javascript + + + + final + + MongoDB\BSON\Javascript + + + + MongoDB\BSON\JavascriptInterface + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + PECL mongodb 1.3.0 + + MongoDB\BSON\JavascriptInterface を実装しました。 + + + + PECL mongodb 1.2.0 + + Implements Serializable and + JsonSerializable. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.javascript; + +
+ + diff --git a/reference/mongodb/bson/javascript/construct.xml b/reference/mongodb/bson/javascript/construct.xml new file mode 100644 index 0000000000..0baa6e11a6 --- /dev/null +++ b/reference/mongodb/bson/javascript/construct.xml @@ -0,0 +1,148 @@ + + + + + + + MongoDB\BSON\Javascript::__construct + 新しい Javascript を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\Javascript::__construct + stringcode + arrayobjectnullscope&null; + + + + + &reftitle.parameters; + + + code (string) + + + Javascript code. + + + + + scope (arrayobject) + + + Javascript scope. + + + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\InvalidArgumentException if code contains null bytes. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 1.2.0 + + + MongoDB\Driver\Exception\InvalidArgumentException + is thrown if code contains null bytes. + Previously, values would be truncated at the first null byte. + + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Javascript::__construct</function> の例 + + 'bar']); +var_dump($codews); + +?> +]]> + + &example.outputs; + + + string(24) "function() { return 1; }" + ["scope"]=> + object(stdClass)#2 (0) { + } +} +object(MongoDB\BSON\Javascript)#2 (2) { + ["javascript"]=> + string(26) "function() { return foo; }" + ["scope"]=> + object(stdClass)#1 (1) { + ["foo"]=> + string(3) "bar" + } +} +]]> + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/javascript/getcode.xml b/reference/mongodb/bson/javascript/getcode.xml new file mode 100644 index 0000000000..9d54fb3fce --- /dev/null +++ b/reference/mongodb/bson/javascript/getcode.xml @@ -0,0 +1,91 @@ + + + + + + + MongoDB\BSON\Javascript::getCode + Javascript の code を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Javascript::getCode + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Javascript's code. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Javascript::getCode</function> の例 + +getCode()); + +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/javascript/getscope.xml b/reference/mongodb/bson/javascript/getscope.xml new file mode 100644 index 0000000000..ed14443ea0 --- /dev/null +++ b/reference/mongodb/bson/javascript/getscope.xml @@ -0,0 +1,98 @@ + + + + + + + MongoDB\BSON\Javascript::getScope + Javascript の scope document を返す + + + + &reftitle.description; + + final public objectnullMongoDB\BSON\Javascript::getScope + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Javascript's scope document, or &null; if the is no scope. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Javascript::getScope</function> の例 + +getScope()); + +$js = new MongoDB\BSON\Javascript('function foo() { return foo; }', ['foo' => 42]); +var_dump($js->getScope()); + +?> +]]> + + &example.outputs; + + + int(42) +} +]]> + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/javascript/jsonserialize.xml b/reference/mongodb/bson/javascript/jsonserialize.xml new file mode 100644 index 0000000000..9fa027a727 --- /dev/null +++ b/reference/mongodb/bson/javascript/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\Javascript::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\Javascript::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\Javascript. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/javascript/tostring.xml b/reference/mongodb/bson/javascript/tostring.xml new file mode 100644 index 0000000000..5141385423 --- /dev/null +++ b/reference/mongodb/bson/javascript/tostring.xml @@ -0,0 +1,86 @@ + + + + + + + MongoDB\BSON\Javascript::__toString + Javascript の code を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Javascript::__toString + + + + &info.method.alias; MongoDB\BSON\Javascript::getCode. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Javascript's code. + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Javascript::__toString</function> の例 + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Javascript::getCode + BSON Types + + + + + + diff --git a/reference/mongodb/bson/javascriptinterface.xml b/reference/mongodb/bson/javascriptinterface.xml new file mode 100644 index 0000000000..2007a21deb --- /dev/null +++ b/reference/mongodb/bson/javascriptinterface.xml @@ -0,0 +1,78 @@ + + + + + + + MongoDB\BSON\JavascriptInterface インターフェイス + MongoDB\BSON\JavascriptInterface + + +
+ &reftitle.intro; + + This interface is implemented by + MongoDB\BSON\Javascript to be used as a parameter, + return, or property type in userland classes. + +
+ +
+ &reftitle.classsynopsis; + + MongoDB\BSON\JavascriptInterface + + + MongoDB\BSON\JavascriptInterface + + + &Methods; + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + &mongodb.changelog.tentative-return-types; + + + + +
+
+ + &reference.mongodb.bson.entities.javascriptinterface; + +
+ + diff --git a/reference/mongodb/bson/javascriptinterface/getcode.xml b/reference/mongodb/bson/javascriptinterface/getcode.xml new file mode 100644 index 0000000000..616071273b --- /dev/null +++ b/reference/mongodb/bson/javascriptinterface/getcode.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\JavascriptInterface::getCode + JavascriptInterface の code を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\JavascriptInterface::getCode + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the JavascriptInterface's code. + + + + + &reftitle.seealso; + + MongoDB\BSON\Javascript::getCode + + + + + + diff --git a/reference/mongodb/bson/javascriptinterface/getscope.xml b/reference/mongodb/bson/javascriptinterface/getscope.xml new file mode 100644 index 0000000000..9de1a776a7 --- /dev/null +++ b/reference/mongodb/bson/javascriptinterface/getscope.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\JavascriptInterface::getScope + JavascriptInterface の scope document を返す + + + + &reftitle.description; + + abstract public objectnullMongoDB\BSON\JavascriptInterface::getScope + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the JavascriptInterface's scope document. + + + + + &reftitle.seealso; + + MongoDB\BSON\Javascript::getScope + + + + + + diff --git a/reference/mongodb/bson/javascriptinterface/tostring.xml b/reference/mongodb/bson/javascriptinterface/tostring.xml new file mode 100644 index 0000000000..ac74deb79a --- /dev/null +++ b/reference/mongodb/bson/javascriptinterface/tostring.xml @@ -0,0 +1,63 @@ + + + + + + + MongoDB\BSON\JavascriptInterface::__toString + JavascriptInterface の code を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\JavascriptInterface::__toString + + + + &info.method.alias; MongoDB\BSON\JavascriptInterface::getCode. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the JavascriptInterface's code. + + + + + &reftitle.seealso; + + MongoDB\BSON\JavascriptInterface::getCode + MongoDB\BSON\Javascript::__toString + + + + + + diff --git a/reference/mongodb/bson/maxkey.xml b/reference/mongodb/bson/maxkey.xml new file mode 100644 index 0000000000..69cc5d153d --- /dev/null +++ b/reference/mongodb/bson/maxkey.xml @@ -0,0 +1,119 @@ + + + + + + + MongoDB\BSON\MaxKey クラス + MongoDB\BSON\MaxKey + + + + +
+ &reftitle.intro; + + Special BSON type which compares higher than all other possible BSON element + values. + + + + This is an internal MongoDB type used for indexing and sharding. + + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\MaxKey + + + + final + + MongoDB\BSON\MaxKey + + + + MongoDB\BSON\MaxKeyInterface + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.3.0 + + MongoDB\BSON\MaxKeyInterface を実装しました。 + + + + PECL mongodb 1.2.0 + + Implements Serializable and + JsonSerializable. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.maxkey; + +
+ + diff --git a/reference/mongodb/bson/maxkey/construct.xml b/reference/mongodb/bson/maxkey/construct.xml new file mode 100644 index 0000000000..4d363aeb31 --- /dev/null +++ b/reference/mongodb/bson/maxkey/construct.xml @@ -0,0 +1,84 @@ + + + + + + + MongoDB\BSON\MaxKey::__construct + 新しい MaxKey を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\MaxKey::__construct + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\MaxKey::__construct</function> の例 + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/maxkey/jsonserialize.xml b/reference/mongodb/bson/maxkey/jsonserialize.xml new file mode 100644 index 0000000000..7c201457c0 --- /dev/null +++ b/reference/mongodb/bson/maxkey/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\MaxKey::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\MaxKey::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\MaxKey. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/maxkeyinterface.xml b/reference/mongodb/bson/maxkeyinterface.xml new file mode 100644 index 0000000000..df9f378962 --- /dev/null +++ b/reference/mongodb/bson/maxkeyinterface.xml @@ -0,0 +1,57 @@ + + + + + + + MongoDB\BSON\MaxKeyInterface インターフェイス + MongoDB\BSON\MaxKeyInterface + + +
+ &reftitle.intro; + + This interface is implemented by MongoDB\BSON\MaxKey + to be used as a parameter, return, or property type in userland classes. + +
+ +
+ &reftitle.classsynopsis; + + MongoDB\BSON\MaxKeyInterface + + + MongoDB\BSON\MaxKeyInterface + + + + + + This interface has no methods. + +
+
+ +
+ + diff --git a/reference/mongodb/bson/minkey.xml b/reference/mongodb/bson/minkey.xml new file mode 100644 index 0000000000..e5e8884eb1 --- /dev/null +++ b/reference/mongodb/bson/minkey.xml @@ -0,0 +1,119 @@ + + + + + + + MongoDB\BSON\MinKey クラス + MongoDB\BSON\MinKey + + + + +
+ &reftitle.intro; + + Special BSON type which compares lower than all other possible BSON element + values. + + + + This is an internal MongoDB type used for indexing and sharding. + + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\MinKey + + + + final + + MongoDB\BSON\MinKey + + + + MongoDB\BSON\MinKeyInterface + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.3.0 + + MongoDB\BSON\MinKeyInterface を実装しました。 + + + + PECL mongodb 1.2.0 + + Implements Serializable and + JsonSerializable. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.minkey; + +
+ + diff --git a/reference/mongodb/bson/minkey/construct.xml b/reference/mongodb/bson/minkey/construct.xml new file mode 100644 index 0000000000..d066881a72 --- /dev/null +++ b/reference/mongodb/bson/minkey/construct.xml @@ -0,0 +1,84 @@ + + + + + + + MongoDB\BSON\MinKey::__construct + 新しい MinKey を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\MinKey::__construct + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\MinKey::__construct</function> の例 + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/minkey/jsonserialize.xml b/reference/mongodb/bson/minkey/jsonserialize.xml new file mode 100644 index 0000000000..450180d35d --- /dev/null +++ b/reference/mongodb/bson/minkey/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\MinKey::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\MinKey::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\MinKey. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/minkeyinterface.xml b/reference/mongodb/bson/minkeyinterface.xml new file mode 100644 index 0000000000..e6ba3a83f2 --- /dev/null +++ b/reference/mongodb/bson/minkeyinterface.xml @@ -0,0 +1,57 @@ + + + + + + + MongoDB\BSON\MinKeyInterface インターフェイス + MongoDB\BSON\MinKeyInterface + + +
+ &reftitle.intro; + + This interface is implemented by MongoDB\BSON\MinKey + to be used as a parameter, return, or property type in userland classes. + +
+ +
+ &reftitle.classsynopsis; + + MongoDB\BSON\MinKeyInterface + + + MongoDB\BSON\MinKeyInterface + + + + + + This interface has no methods. + +
+
+ +
+ + diff --git a/reference/mongodb/bson/objectid.xml b/reference/mongodb/bson/objectid.xml new file mode 100644 index 0000000000..e4ca3fb82a --- /dev/null +++ b/reference/mongodb/bson/objectid.xml @@ -0,0 +1,151 @@ + + + + + + + MongoDB\BSON\ObjectId クラス + MongoDB\BSON\ObjectId + + + + +
+ &reftitle.intro; + + BSON type for an + ObjectId. The + value consists of 12 bytes, where the first four bytes are a timestamp + that reflect the ObjectId's creation. Specifically, the value consists of: + + + a 4-byte value representing the seconds since the Unix epoch, + a 5-byte random number unique to a machine and process, and + a 3-byte counter, starting with a random value. + + + In MongoDB, each document stored in a collection requires a unique + _id field that acts as a primary key. If an inserted + document omits the _id field, the extension automatically + generates an ObjectId for the _id field. + + + Using ObjectIds for the _id field provides the following + additional benefits: + + + The creation time of the ObjectId may be accessed using the MongoDB\BSON\ObjectId::getTimestamp method. + Sorting on an _id field that stores ObjectId values is roughly equivalent to sorting by creation time. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\ObjectId + + + + final + + MongoDB\BSON\ObjectId + + + + MongoDB\BSON\ObjectIdInterface + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + PECL mongodb 1.3.0 + + + Renamed from MongoDB\BSON\ObjectID to + MongoDB\BSON\ObjectId. + + + MongoDB\BSON\ObjectIdInterface を実装しました。 + + + + + PECL mongodb 1.2.0 + + Implements Serializable and + JsonSerializable. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.objectid; + +
+ + diff --git a/reference/mongodb/bson/objectid/construct.xml b/reference/mongodb/bson/objectid/construct.xml new file mode 100644 index 0000000000..e7c67441a6 --- /dev/null +++ b/reference/mongodb/bson/objectid/construct.xml @@ -0,0 +1,105 @@ + + + + + + + MongoDB\BSON\ObjectId::__construct + 新しい ObjectId を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\ObjectId::__construct + stringnullid&null; + + + + + &reftitle.parameters; + + + id (string) + + + A 24-character hexadecimal string. If not provided, the extension will + generate an ObjectId. + + + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\InvalidArgumentException if id is not a 24-character hexadecimal string. + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\ObjectId::__construct</function> の例 + + +]]> + + &example.outputs.similar; + + + string(24) "56732d3dda14d81214634921" +} +object(MongoDB\BSON\ObjectId)#1 (1) { + ["oid"]=> + string(24) "000000000000000000000001" +} + +]]> + + + + + + + &reftitle.seealso; + + ObjectId Reference + BSON Types: ObjectId + + + + + + diff --git a/reference/mongodb/bson/objectid/gettimestamp.xml b/reference/mongodb/bson/objectid/gettimestamp.xml new file mode 100644 index 0000000000..5e7dc5b534 --- /dev/null +++ b/reference/mongodb/bson/objectid/gettimestamp.xml @@ -0,0 +1,100 @@ + + + + + + + MongoDB\BSON\ObjectId::getTimestamp + timestamp component of this ObjectId を返す + + + + &reftitle.description; + + final public intMongoDB\BSON\ObjectId::getTimestamp + + + + The timestamp component of an ObjectId is its most significant 32 bits, which + denotes the number of seconds since the Unix epoch. This value is read as an + unsigned 32-bit integer with big-endian byte order. + + &mongodb.note.uint32; + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the timestamp component of this ObjectId. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\ObjectId::getTimestamp</function> の例 + +getTimestamp()); + +var_dump((new MongoDB\BSON\ObjectId('0000002a0000000000000000'))->getTimestamp()); + +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + ObjectId Reference + BSON Types: ObjectId + + + + + + diff --git a/reference/mongodb/bson/objectid/jsonserialize.xml b/reference/mongodb/bson/objectid/jsonserialize.xml new file mode 100644 index 0000000000..7f6068544c --- /dev/null +++ b/reference/mongodb/bson/objectid/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\ObjectId::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\ObjectId::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\ObjectId. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/objectid/tostring.xml b/reference/mongodb/bson/objectid/tostring.xml new file mode 100644 index 0000000000..2763c243b8 --- /dev/null +++ b/reference/mongodb/bson/objectid/tostring.xml @@ -0,0 +1,85 @@ + + + + + + + MongoDB\BSON\ObjectId::__toString + hexidecimal representation of this ObjectId を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\ObjectId::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the hexidecimal representation of this ObjectId. + + + + + &reftitle.examples; + + <function>MongoDB\BSON\ObjectId::__toString</function> の例 + + +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + ObjectId Reference + BSON Types: ObjectId + + + + + + diff --git a/reference/mongodb/bson/objectidinterface.xml b/reference/mongodb/bson/objectidinterface.xml new file mode 100644 index 0000000000..2ccde5310a --- /dev/null +++ b/reference/mongodb/bson/objectidinterface.xml @@ -0,0 +1,78 @@ + + + + + + + MongoDB\BSON\ObjectIdInterface インターフェイス + MongoDB\BSON\ObjectIdInterface + + +
+ &reftitle.intro; + + This interface is implemented by + MongoDB\BSON\ObjectId to be used as a parameter, + return, or property type in userland classes. + +
+ +
+ &reftitle.classsynopsis; + + MongoDB\BSON\ObjectIdInterface + + + MongoDB\BSON\ObjectIdInterface + + + &Methods; + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + &mongodb.changelog.tentative-return-types; + + + + +
+
+ + &reference.mongodb.bson.entities.objectidinterface; + +
+ + diff --git a/reference/mongodb/bson/objectidinterface/gettimestamp.xml b/reference/mongodb/bson/objectidinterface/gettimestamp.xml new file mode 100644 index 0000000000..3241a1ba55 --- /dev/null +++ b/reference/mongodb/bson/objectidinterface/gettimestamp.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\ObjectIdInterface::getTimestamp + timestamp component of this ObjectIdInterface を返す + + + + &reftitle.description; + + abstract public intMongoDB\BSON\ObjectIdInterface::getTimestamp + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the timestamp component of this ObjectIdInterface. + + + + + &reftitle.seealso; + + MongoDB\BSON\ObjectId::getTimestamp + + + + + + diff --git a/reference/mongodb/bson/objectidinterface/tostring.xml b/reference/mongodb/bson/objectidinterface/tostring.xml new file mode 100644 index 0000000000..a1ef8d5a3b --- /dev/null +++ b/reference/mongodb/bson/objectidinterface/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\ObjectIdInterface::__toString + hexidecimal representation of this ObjectIdInterface を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\ObjectIdInterface::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the hexidecimal representation of this ObjectIdInterface. + + + + + &reftitle.seealso; + + MongoDB\BSON\ObjectId::__toString + + + + + + diff --git a/reference/mongodb/bson/packedarray.xml b/reference/mongodb/bson/packedarray.xml new file mode 100644 index 0000000000..c00bae7cc6 --- /dev/null +++ b/reference/mongodb/bson/packedarray.xml @@ -0,0 +1,115 @@ + + + + + + + MongoDB\BSON\PackedArray クラス + MongoDB\BSON\PackedArray + + + + +
+ &reftitle.intro; + + Represents a BSON array. This class is used when reading data as raw BSON + and cannot be modified. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\PackedArray + + + + final + + MongoDB\BSON\PackedArray + + + + MongoDB\BSON\Type + + + + ArrayAccess + + + + IteratorAggregate + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.17.0 + + MongoDB\BSON\Type を実装しました。 + + + + PECL mongodb 1.17.0 + + MongoDB\BSON\PackedArray cannot be serialized + in contexts where a BSON document is expected. In earlier versions, + the BSON array would have been converted to a document. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.packedarray; + +
+ + diff --git a/reference/mongodb/bson/packedarray/construct.xml b/reference/mongodb/bson/packedarray/construct.xml new file mode 100644 index 0000000000..4bd8fb5700 --- /dev/null +++ b/reference/mongodb/bson/packedarray/construct.xml @@ -0,0 +1,57 @@ + + + + + + + MongoDB\BSON\PackedArray::__construct + 新しい BSON array (unused) を作成する + + + + &reftitle.description; + + final private MongoDB\BSON\PackedArray::__construct + + + + MongoDB\BSON\PackedArray objects are created through + static factory methods and cannot be instantiated directly. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + MongoDB\BSON\PackedArray::fromPHP + BSON Types + + + + + + diff --git a/reference/mongodb/bson/packedarray/fromjson.xml b/reference/mongodb/bson/packedarray/fromjson.xml new file mode 100644 index 0000000000..1fc334d80c --- /dev/null +++ b/reference/mongodb/bson/packedarray/fromjson.xml @@ -0,0 +1,127 @@ + + + + + + MongoDB\BSON\PackedArray::fromJSON + 新しい BSON array instance from a JSON string を作成する + + + + &reftitle.description; + + final static public MongoDB\BSON\PackedArrayMongoDB\BSON\PackedArray::fromJSON + stringjson + + + Converts an + extended JSON + string to its BSON representation. + + + + + &reftitle.parameters; + + + json (string) + + + JSON value to be converted. + + + + + + + + &reftitle.returnvalues; + + Returns a new MongoDB\BSON\PackedArray instance. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + Throws + MongoDB\Driver\Exception\UnexpectedValueException if + the JSON value cannot be converted to a BSON array (e.g. due to a syntax + error). + + + + + + &reftitle.examples; + + <methodname>MongoDB\BSON\PackedArray::fromJSON</methodname> の例 + + +]]> + + &example.outputs; + + + string(68) "MQAAAAIwAAQAAABmb28AEDEAewAAABIyAP////8AAAAABzMAVjFafGEY/RuSAnCxAA==" + ["value"]=> + array(4) { + [0]=> + string(3) "foo" + [1]=> + int(123) + [2]=> + int(4294967295) + [3]=> + object(MongoDB\BSON\ObjectId)#2 (1) { + ["oid"]=> + string(24) "56315a7c6118fd1b920270b1" + } + } +} +]]> + + + + + + &reftitle.seealso; + + MongoDB\BSON\PackedArray::fromPHP + MongoDB Extended JSON + BSON Types + + + + + diff --git a/reference/mongodb/bson/packedarray/fromphp.xml b/reference/mongodb/bson/packedarray/fromphp.xml new file mode 100644 index 0000000000..0b86d0dfdb --- /dev/null +++ b/reference/mongodb/bson/packedarray/fromphp.xml @@ -0,0 +1,77 @@ + + + + + + + MongoDB\BSON\PackedArray::fromPHP + 新しい BSON array instance from PHP data を作成する + + + + &reftitle.description; + + final static public MongoDB\BSON\PackedArrayMongoDB\BSON\PackedArray::fromPHP + arrayvalue + + + + + &reftitle.parameters; + + + value (array) + + + The PHP array to convert to a BSON array. The array must be a list (i.e. + have sequential numeric keys starting with 0). + + + + + + + + &reftitle.returnvalues; + + Returns a new MongoDB\BSON\PackedArray instance. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\InvalidArgumentException if the given array is not a list (i.e. has sequential numeric keys starting with 0). + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/packedarray/get.xml b/reference/mongodb/bson/packedarray/get.xml new file mode 100644 index 0000000000..83c7c75879 --- /dev/null +++ b/reference/mongodb/bson/packedarray/get.xml @@ -0,0 +1,85 @@ + + + + + + + MongoDB\BSON\PackedArray::get + value of an index in the array を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\PackedArray::get + intkey + + + + + &reftitle.parameters; + + + key (int) + + + The index to retrieve from the array. + + + + + + + + &reftitle.returnvalues; + + Returns the value associated with the given index. If the index is not + present in the array, an exception is thrown. + + + + When encountering a value encoded as 64-bit integer in the BSON array, + the return value of this method will be a + MongoDB\BSON\Int64 instance. + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\RuntimeException if the index is not present in the array. + + + + + &reftitle.seealso; + + MongoDB\BSON\PackedArray::has + BSON Types + + + + + + diff --git a/reference/mongodb/bson/packedarray/getiterator.xml b/reference/mongodb/bson/packedarray/getiterator.xml new file mode 100644 index 0000000000..8e2908da8f --- /dev/null +++ b/reference/mongodb/bson/packedarray/getiterator.xml @@ -0,0 +1,68 @@ + + + + + + + MongoDB\BSON\PackedArray::getIterator + iterator for the BSON array を返す + + + + &reftitle.description; + + final public MongoDB\BSON\IteratorMongoDB\BSON\PackedArray::getIterator + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a MongoDB\BSON\Iterator instance that can be + used to iterate over all indexes in the array. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\UnexpectedValueException if the BSON iterator could not be initialized. + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/packedarray/has.xml b/reference/mongodb/bson/packedarray/has.xml new file mode 100644 index 0000000000..0b378b21f2 --- /dev/null +++ b/reference/mongodb/bson/packedarray/has.xml @@ -0,0 +1,76 @@ + + + + + + + MongoDB\BSON\PackedArray::has + a index is present in the array かどうかを返す + + + + &reftitle.description; + + final public boolMongoDB\BSON\PackedArray::has + intindex + + + + + &reftitle.parameters; + + + index (int) + + + The index to look for in the array. + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the index is present in the array and &false; otherwise. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + MongoDB\BSON\PackedArray::get + BSON Types + + + + + + diff --git a/reference/mongodb/bson/packedarray/offsetexists.xml b/reference/mongodb/bson/packedarray/offsetexists.xml new file mode 100644 index 0000000000..ce7eb89aea --- /dev/null +++ b/reference/mongodb/bson/packedarray/offsetexists.xml @@ -0,0 +1,70 @@ + + + + + + MongoDB\BSON\PackedArray::offsetExists + a index is present in the array かどうかを返す + + + &reftitle.description; + + final public boolMongoDB\BSON\PackedArray::offsetExists + mixedkey + + + + + &reftitle.parameters; + + + + key + + + The index to look for in the array. + + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the index is present in the array and &false; otherwise. + + + + + &reftitle.seealso; + + + ArrayAccess::offsetExists + MongoDB\BSON\PackedArray::has + + + + + + diff --git a/reference/mongodb/bson/packedarray/offsetget.xml b/reference/mongodb/bson/packedarray/offsetget.xml new file mode 100644 index 0000000000..ed38d54b59 --- /dev/null +++ b/reference/mongodb/bson/packedarray/offsetget.xml @@ -0,0 +1,86 @@ + + + + + + MongoDB\BSON\PackedArray::offsetGet + value of an index in the array を返す + + + &reftitle.description; + + final public mixedMongoDB\BSON\PackedArray::offsetGet + mixedkey + + + + + &reftitle.parameters; + + + + key + + + The index to retrieve from the array. Only int is supported. + + + + + + + + + &reftitle.returnvalues; + + Returns the value associated with the given index. If the index is not + present in the array, an exception is thrown. + + + + When encountering a value encoded as 64-bit integer in the BSON array, + the return value of this method will be a + MongoDB\BSON\Int64 instance. + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\RuntimeException if the index is not present in the array. + + + + + &reftitle.seealso; + + + ArrayAccess::offsetGet + MongoDB\BSON\PackedArray::get + + + + + + diff --git a/reference/mongodb/bson/packedarray/offsetset.xml b/reference/mongodb/bson/packedarray/offsetset.xml new file mode 100644 index 0000000000..c09a2d81f4 --- /dev/null +++ b/reference/mongodb/bson/packedarray/offsetset.xml @@ -0,0 +1,80 @@ + + + + + + MongoDB\BSON\PackedArray::offsetSet + ArrayAccess の実装 + + + &reftitle.description; + + final public voidMongoDB\BSON\PackedArray::offsetSet + mixedkey + mixedvalue + + + + 指定された key の値を value に設定します。 + + + + + &reftitle.parameters; + + + + key + + + 設定するインデックス。 + + + + + value + + + key の新しい値。 + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + 常に MongoDB\Driver\Exception\LogicException をスローします。 + + + + + diff --git a/reference/mongodb/bson/packedarray/offsetunset.xml b/reference/mongodb/bson/packedarray/offsetunset.xml new file mode 100644 index 0000000000..c6ccf0ce02 --- /dev/null +++ b/reference/mongodb/bson/packedarray/offsetunset.xml @@ -0,0 +1,70 @@ + + + + + + MongoDB\BSON\PackedArray::offsetUnset + ArrayAccess の実装 + + + &reftitle.description; + + final public voidMongoDB\BSON\PackedArray::offsetUnset + mixedkey + + + Unsets the value at the specified index. + + + + + &reftitle.parameters; + + + + key + + + 解除するインデックス。 + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + 常に MongoDB\Driver\Exception\LogicException をスローします。 + + + + + diff --git a/reference/mongodb/bson/packedarray/tocanonicalextendedjson.xml b/reference/mongodb/bson/packedarray/tocanonicalextendedjson.xml new file mode 100644 index 0000000000..068c3c8a61 --- /dev/null +++ b/reference/mongodb/bson/packedarray/tocanonicalextendedjson.xml @@ -0,0 +1,101 @@ + + + + + + MongoDB\BSON\PackedArray::toCanonicalExtendedJSON + Canonical Extended JSON representation of the BSON array を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\PackedArray::toCanonicalExtendedJSON + + + + Converts the BSON array to its + Canonical Extended JSON + representation. The canonical format prefers type fidelity at the expense of + concise output and is most suited for producing output that can be converted + back to BSON without any loss of type information (e.g. numeric types will + remain differentiated). + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a string containing the + Canonical Extended JSON + representation of the BSON array. + + + + + &reftitle.examples; + + <methodname>MongoDB\BSON\PackedArray::toCanonicalExtendedJSON</methodname> の例 + + toCanonicalExtendedJSON(), "\n"; + +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\PackedArray::fromJSON + MongoDB\BSON\PackedArray::toRelaxedExtendedJSON + MongoDB\BSON\toCanonicalExtendedJSON + Extended JSON Specification + BSON Types + + + + + diff --git a/reference/mongodb/bson/packedarray/tophp.xml b/reference/mongodb/bson/packedarray/tophp.xml new file mode 100644 index 0000000000..0b1f7e1f09 --- /dev/null +++ b/reference/mongodb/bson/packedarray/tophp.xml @@ -0,0 +1,81 @@ + + + + + + + MongoDB\BSON\PackedArray::toPHP + PHP representation of the BSON array を返す + + + + &reftitle.description; + + final public arrayobjectMongoDB\BSON\PackedArray::toPHP + arraynulltypeMap&null; + + + + + &reftitle.parameters; + + &mongodb.parameter.typeMap; + + + + + &reftitle.returnvalues; + + The decoded PHP value. + + + + When encountering a value encoded as 64-bit integer in the BSON array, + the return value of this method will be a + MongoDB\BSON\Int64 instance. + + + + + + &reftitle.errors; + + + Throws + MongoDB\Driver\Exception\InvalidArgumentException if + a class in the type map cannot be instantiated or does not implement + MongoDB\BSON\Unserializable. + + + + + + &reftitle.seealso; + + MongoDB\BSON\toPHP + BSON Types + + + + + + diff --git a/reference/mongodb/bson/packedarray/torelaxedextendedjson.xml b/reference/mongodb/bson/packedarray/torelaxedextendedjson.xml new file mode 100644 index 0000000000..a9b9185e5b --- /dev/null +++ b/reference/mongodb/bson/packedarray/torelaxedextendedjson.xml @@ -0,0 +1,100 @@ + + + + + + MongoDB\BSON\PackedArray::toRelaxedExtendedJSON + Relaxed Extended JSON representation of the BSON array を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\PackedArray::toRelaxedExtendedJSON + + + + Converts the BSON array to its + Relaxed Extended JSON + representation. The relaxed format prefers use of JSON type primitives at the + expense of type fidelity and is most suited for producing output that can be + easily consumed by web APIs and humans. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a string containing the + Relaxed Extended JSON + representation of the BSON array. + + + + + &reftitle.examples; + + <methodname>MongoDB\BSON\PackedArray::toRelaxedExtendedJSON</methodname> の例 + + toRelaxedExtendedJSON(), "\n"; + +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\PackedArray::fromJSON + MongoDB\BSON\PackedArray::toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + Extended JSON Specification + BSON Types + + + + + diff --git a/reference/mongodb/bson/packedarray/tostring.xml b/reference/mongodb/bson/packedarray/tostring.xml new file mode 100644 index 0000000000..cc2e088623 --- /dev/null +++ b/reference/mongodb/bson/packedarray/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\PackedArray::__toString + string representation of this BSON array を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\PackedArray::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this array as BSON. + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/persistable.xml b/reference/mongodb/bson/persistable.xml new file mode 100644 index 0000000000..075b5a6be6 --- /dev/null +++ b/reference/mongodb/bson/persistable.xml @@ -0,0 +1,98 @@ + + + + + + + MongoDB\BSON\Persistable インターフェイス + MongoDB\BSON\Persistable + + + + +
+ &reftitle.intro; + + Classes may implement this interface to take advantage of automatic ODM + (object document mapping) behavior in the extension. During serialization, + the extension will inject a __pclass property + containing the PHP class name into the data returned by + MongoDB\BSON\Serializable::bsonSerialize. During + unserialization, the same __pclass property will then + be used to infer the PHP class (independent of any + type map configuration) + to be constructed before + MongoDB\BSON\Unserializable::bsonUnserialize is + invoked. See for additional + information. + + + + Even if MongoDB\BSON\Serializable::bsonSerialize would + return a sequential array, injection of the __pclass + property will cause the object to be serialized as a BSON document. + + +
+ + +
+ &reftitle.interfacesynopsis; + + + + MongoDB\BSON\Persistable + + + + + MongoDB\BSON\Persistable + + + + MongoDB\BSON\Unserializable + + + + MongoDB\BSON\Serializable + + + + + &Methods; + + + &InheritedMethods; + + + + + +
+ +
+ + &reference.mongodb.bson.entities.persistable; + +
+ + diff --git a/reference/mongodb/bson/persistable/bsonserialize.xml b/reference/mongodb/bson/persistable/bsonserialize.xml new file mode 100644 index 0000000000..b1a927851c --- /dev/null +++ b/reference/mongodb/bson/persistable/bsonserialize.xml @@ -0,0 +1,110 @@ + + + + + + + MongoDB\BSON\Persistable::bsonSerialize + BSON としてシリアライズする配列またはドキュメントを提供する + + + + &reftitle.description; + + abstract public arraystdClassMongoDB\BSON\DocumentMongoDB\BSON\Persistable::bsonSerialize + + + + Called during serialization of the object to BSON. The method must return an + array, stdClass, or + MongoDB\BSON\Document. + + + The return value will always be serialized as a BSON document. The serialized + document will include a field containing the class name of the object. For + this reason, it is not possible to return a + MongoDB\BSON\PackedArray instance in this method. + + + Users are encouraged to include an _id property (e.g. a + MongoDB\BSON\ObjectId initialized in the constructor) + when returning data for a BSON root document. In the absence of an + _id property, the extension or server will generate a + MongoDB\BSON\ObjectId for insert or upsert + operations, respectively. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + An array, stdClass, or MongoDB\BSON\Document + to be serialized as a BSON document. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + + PECL mongodb 1.17.0 + + + This method may now also return MongoDB\BSON\Document + instances in addition to array and stdClass. + + + + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Serializable::bsonSerialize + MongoDB\BSON\Unserializable::bsonUnserialize + MongoDB\BSON\Persistable + + + + + + + diff --git a/reference/mongodb/bson/regex.xml b/reference/mongodb/bson/regex.xml new file mode 100644 index 0000000000..ef1286a5f0 --- /dev/null +++ b/reference/mongodb/bson/regex.xml @@ -0,0 +1,132 @@ + + + + + + + MongoDB\BSON\Regex クラス + MongoDB\BSON\Regex + + + + +
+ &reftitle.intro; + + BSON type for a regular expression pattern and optional + flags. + + + + This BSON type is mainly used when querying the database. Alternatively, + the + $regex + query operator may be used. + + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Regex + + + + final + + MongoDB\BSON\Regex + + + + MongoDB\BSON\RegexInterface + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + PECL mongodb 1.3.0 + + MongoDB\BSON\RegexInterface を実装しました。 + + + + PECL mongodb 1.2.0 + + Implements Serializable and + JsonSerializable. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.regex; + +
+ + diff --git a/reference/mongodb/bson/regex/construct.xml b/reference/mongodb/bson/regex/construct.xml new file mode 100644 index 0000000000..c9c87fa738 --- /dev/null +++ b/reference/mongodb/bson/regex/construct.xml @@ -0,0 +1,153 @@ + + + + + + + MongoDB\BSON\Regex::__construct + 新しい Regex を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\Regex::__construct + stringpattern + stringflags"" + + + + + &reftitle.parameters; + + + pattern (string) + + + The regular expression pattern. + + + + The pattern should not be wrapped with delimiter characters. + + + + + + flags (string) + + + The regular + expression flags. Characters in this argument will be sorted + alphabetically. + + + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + Throws MongoDB\Driver\Exception\InvalidArgumentException if pattern or flags contain null bytes. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 1.2.0 + + + The flags argument is optional and defaults to + an empty string. + + + Characters in the flags argument will be sorted + alphabetically when a Regex is constructed. Previously, the characters + were stored in the order provided. + + + MongoDB\Driver\Exception\InvalidArgumentException + is thrown if pattern or + flags contain null bytes. Previously, values + would be truncated at the first null byte. + + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Regex::__construct</function> の例 + + +]]> + + &example.outputs; + + + string(4) "^foo" + ["flags"]=> + string(1) "i" +} +]]> + + + + + + + &reftitle.seealso; + + BSON Types + Supported regular expression flags + + + + + + diff --git a/reference/mongodb/bson/regex/getflags.xml b/reference/mongodb/bson/regex/getflags.xml new file mode 100644 index 0000000000..68a43e38c8 --- /dev/null +++ b/reference/mongodb/bson/regex/getflags.xml @@ -0,0 +1,92 @@ + + + + + + + MongoDB\BSON\Regex::getFlags + Regex の flags を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Regex::getFlags + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Regex's flags. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Regex::getFlags</function> の例 + +getFlags()); + +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + BSON Types + Supported regular expression flags + + + + + + diff --git a/reference/mongodb/bson/regex/getpattern.xml b/reference/mongodb/bson/regex/getpattern.xml new file mode 100644 index 0000000000..34f9610519 --- /dev/null +++ b/reference/mongodb/bson/regex/getpattern.xml @@ -0,0 +1,91 @@ + + + + + + + MongoDB\BSON\Regex::getPattern + Regex の pattern を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Regex::getPattern + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the Regex's pattern. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Regex::getPattern</function> の例 + +getPattern()); + +?> +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/regex/jsonserialize.xml b/reference/mongodb/bson/regex/jsonserialize.xml new file mode 100644 index 0000000000..a90d62ed95 --- /dev/null +++ b/reference/mongodb/bson/regex/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\Regex::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\Regex::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\Regex. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/regex/tostring.xml b/reference/mongodb/bson/regex/tostring.xml new file mode 100644 index 0000000000..259298942b --- /dev/null +++ b/reference/mongodb/bson/regex/tostring.xml @@ -0,0 +1,83 @@ + + + + + + + MongoDB\BSON\Regex::__toString + string representation of this Regex を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Regex::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this Regex. + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Regex::__toString</function> の例 + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/regexinterface.xml b/reference/mongodb/bson/regexinterface.xml new file mode 100644 index 0000000000..447aec8ed7 --- /dev/null +++ b/reference/mongodb/bson/regexinterface.xml @@ -0,0 +1,77 @@ + + + + + + + MongoDB\BSON\RegexInterface インターフェイス + MongoDB\BSON\RegexInterface + + +
+ &reftitle.intro; + + This interface is implemented by MongoDB\BSON\Regex + to be used as a parameter, return, or property type in userland classes. + +
+ +
+ &reftitle.classsynopsis; + + MongoDB\BSON\RegexInterface + + + MongoDB\BSON\RegexInterface + + + &Methods; + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + &mongodb.changelog.tentative-return-types; + + + + +
+
+ + &reference.mongodb.bson.entities.regexinterface; + +
+ + diff --git a/reference/mongodb/bson/regexinterface/getflags.xml b/reference/mongodb/bson/regexinterface/getflags.xml new file mode 100644 index 0000000000..bb1e5bd5e7 --- /dev/null +++ b/reference/mongodb/bson/regexinterface/getflags.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\RegexInterface::getFlags + RegexInterface の flags を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\RegexInterface::getFlags + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the RegexInterface's flags. + + + + + &reftitle.seealso; + + MongoDB\BSON\Regex::getFlags + + + + + + diff --git a/reference/mongodb/bson/regexinterface/getpattern.xml b/reference/mongodb/bson/regexinterface/getpattern.xml new file mode 100644 index 0000000000..e7d8eca2ea --- /dev/null +++ b/reference/mongodb/bson/regexinterface/getpattern.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\RegexInterface::getPattern + RegexInterface の pattern を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\RegexInterface::getPattern + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the RegexInterface's pattern. + + + + + &reftitle.seealso; + + MongoDB\BSON\Regex::getPattern + + + + + + diff --git a/reference/mongodb/bson/regexinterface/tostring.xml b/reference/mongodb/bson/regexinterface/tostring.xml new file mode 100644 index 0000000000..9005a34700 --- /dev/null +++ b/reference/mongodb/bson/regexinterface/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\RegexInterface::__toString + string representation of this RegexInterface を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\RegexInterface::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this RegexInterface. + + + + + &reftitle.seealso; + + MongoDB\BSON\Regex::__toString + + + + + + diff --git a/reference/mongodb/bson/serializable.xml b/reference/mongodb/bson/serializable.xml new file mode 100644 index 0000000000..f7d64783bf --- /dev/null +++ b/reference/mongodb/bson/serializable.xml @@ -0,0 +1,92 @@ + + + + + + + MongoDB\BSON\Serializable インターフェイス + MongoDB\BSON\Serializable + + + + +
+ &reftitle.intro; + + Classes that implement this interface may return data to be serialized as a + BSON array or document in lieu of the object's public properties. + +
+ + +
+ &reftitle.interfacesynopsis; + + + + MongoDB\BSON\Serializable + + + + + MongoDB\BSON\Serializable + + + + MongoDB\BSON\Type + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + &mongodb.changelog.tentative-return-types; + + + + +
+
+ + &reference.mongodb.bson.entities.serializable; + +
+ + diff --git a/reference/mongodb/bson/serializable/bsonserialize.xml b/reference/mongodb/bson/serializable/bsonserialize.xml new file mode 100644 index 0000000000..b7d52244d5 --- /dev/null +++ b/reference/mongodb/bson/serializable/bsonserialize.xml @@ -0,0 +1,248 @@ + + + + + + + MongoDB\BSON\Serializable::bsonSerialize + BSON としてシリアライズする配列またはドキュメントを提供する + + + + &reftitle.description; + + abstract public arraystdClassMongoDB\BSON\DocumentMongoDB\BSON\PackedArrayMongoDB\BSON\Serializable::bsonSerialize + + + + Called during serialization of the object to BSON. The method must return an + array, stdClass, MongoDB\BSON\Document, + or MongoDB\BSON\PackedArray. + + + Root documents (e.g. a + MongoDB\BSON\Serializable passed to + MongoDB\BSON\Document::fromPHP) will always be + serialized as a BSON document. For field values, associative arrays and + stdClass instances will be serialized as a BSON + document and sequential arrays (i.e. sequential, numeric indexes starting at + 0) will be serialized as a BSON array. + + + Users are encouraged to include an _id property (e.g. a + MongoDB\BSON\ObjectId initialized in the constructor) + when returning data for a BSON root document. In the absence of an + _id property, the extension or server will generate a + MongoDB\BSON\ObjectId for insert or upsert + operations, respectively. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + An array, stdClass, MongoDB\BSON\Document, + or MongoDB\BSON\PackedArray to be serialized as a BSON + array or document. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + + PECL mongodb 1.17.0 + + + The return type was changed from arrayobject. + Instead of object, the return type now specifies stdClass. + Classes that implement this interface must be changed to no longer + declare an object return type. As the return type is + tentative, a deprecation warning is emitted on PHP 8.1 and newer. + + + In addition to the changes above, the extension now also supports + returning instances of MongoDB\BSON\Document + and MongoDB\BSON\PackedArray. Please note that + any MongoDB\BSON\PackedArray instances returned + are silently converted to objects when stored as root documents. They + are stored as arrays when used as an embedded field value. + + + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Serializable::bsonSerialize</function> returning an associative array for root document + +id = new MongoDB\BSON\ObjectId; + } + + function bsonSerialize(): array + { + return ['_id' => $this->id, 'foo' => 'bar']; + } +} + +echo MongoDB\BSON\Document::fromPHP(new MyDocument)->toRelaxedExtendedJSON(), "\n"; + +?> +]]> + + &example.outputs.similar; + + + + + + + <function>MongoDB\BSON\Serializable::bsonSerialize</function> returning a sequential array for root document + +toRelaxedExtendedJSON(), "\n"; + +?> +]]> + + &example.outputs; + + + + + + + <function>MongoDB\BSON\Serializable::bsonSerialize</function> returning an associative array for document field + + 'bar']; + } +} + +$value = ['document' => new MyDocument]; + +echo MongoDB\BSON\Document::fromPHP($value)->toRelaxedExtendedJSON(), "\n"; + +?> +]]> + + &example.outputs; + + + + + + + <function>MongoDB\BSON\Serializable::bsonSerialize</function> returning a sequential array for document field + + new MyArray]; + +echo MongoDB\BSON\Document::fromPHP($value)->toRelaxedExtendedJSON(), "\n"; + +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Unserializable::bsonUnserialize + MongoDB\BSON\Persistable + + + + + + + diff --git a/reference/mongodb/bson/symbol.xml b/reference/mongodb/bson/symbol.xml new file mode 100644 index 0000000000..0eea134f13 --- /dev/null +++ b/reference/mongodb/bson/symbol.xml @@ -0,0 +1,109 @@ + + + + + + + MongoDB\BSON\Symbol クラス + MongoDB\BSON\Symbol + + + + +
+ &reftitle.intro; + + BSON type for the "Symbol" type. This BSON type is deprecated, and this + class can not be instantiated. It will be created from a BSON symbol + type while converting BSON to PHP, and can also be converted back into + BSON while storing documents in the database. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Symbol + + + + final + + MongoDB\BSON\Symbol + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.symbol; + +
+ + diff --git a/reference/mongodb/bson/symbol/construct.xml b/reference/mongodb/bson/symbol/construct.xml new file mode 100644 index 0000000000..b589ad6da0 --- /dev/null +++ b/reference/mongodb/bson/symbol/construct.xml @@ -0,0 +1,56 @@ + + + + + + + MongoDB\BSON\Symbol::__construct + 新しい Symbol (unused) を作成する + + + + &reftitle.description; + + final private MongoDB\BSON\Symbol::__construct + + + + MongoDB\BSON\Symbol objects are created through + conversion from a deprecated BSON type and cannot be constructed directly. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/symbol/jsonserialize.xml b/reference/mongodb/bson/symbol/jsonserialize.xml new file mode 100644 index 0000000000..03e43ffb1c --- /dev/null +++ b/reference/mongodb/bson/symbol/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\Symbol::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\Symbol::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\Symbol. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/symbol/tostring.xml b/reference/mongodb/bson/symbol/tostring.xml new file mode 100644 index 0000000000..0308094e65 --- /dev/null +++ b/reference/mongodb/bson/symbol/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\Symbol::__toString + Symbol as a string を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Symbol::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this Symbol. + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/timestamp.xml b/reference/mongodb/bson/timestamp.xml new file mode 100644 index 0000000000..d34c11c418 --- /dev/null +++ b/reference/mongodb/bson/timestamp.xml @@ -0,0 +1,133 @@ + + + + + + + MongoDB\BSON\Timestamp クラス + MongoDB\BSON\Timestamp + + + + +
+ &reftitle.intro; + + Represents a + BSON timestamp, + The value consists of a 4-byte timestamp (i.e. seconds since the epoch) and + a 4-byte increment. + + + + This is an internal MongoDB type used for replication and sharding. It is + not intended for general date storage + (MongoDB\BSON\UTCDateTime should be used instead). + + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Timestamp + + + + final + + MongoDB\BSON\Timestamp + + + + MongoDB\BSON\TimestampInterface + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + PECL mongodb 1.3.0 + + MongoDB\BSON\TimestampInterface を実装しました。 + + + + PECL mongodb 1.2.0 + + Implements Serializable and + JsonSerializable. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.timestamp; + +
+ + diff --git a/reference/mongodb/bson/timestamp/construct.xml b/reference/mongodb/bson/timestamp/construct.xml new file mode 100644 index 0000000000..eeab24e3a3 --- /dev/null +++ b/reference/mongodb/bson/timestamp/construct.xml @@ -0,0 +1,107 @@ + + + + + + + MongoDB\BSON\Timestamp::__construct + 新しい Timestamp を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\Timestamp::__construct + intincrement + inttimestamp + + + + + &reftitle.parameters; + + + increment (int) + + + 32-bit integer denoting the incrementing ordinal for operations within a + given second. + + + + + timestamp (int) + + + 32-bit integer denoting seconds since the Unix epoch. + + + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Timestamp::__construct</function> の例 + + +]]> + + &example.outputs; + + + int(1234) + ["timestamp"]=> + int(5678) +} +]]> + + + + + + + &reftitle.seealso; + + BSON Types: Timestamps + + + + + + diff --git a/reference/mongodb/bson/timestamp/getincrement.xml b/reference/mongodb/bson/timestamp/getincrement.xml new file mode 100644 index 0000000000..23d685e75a --- /dev/null +++ b/reference/mongodb/bson/timestamp/getincrement.xml @@ -0,0 +1,79 @@ + + + + + + + MongoDB\BSON\Timestamp::getIncrement + increment component of this Timestamp を返す + + + + &reftitle.description; + + final public intMongoDB\BSON\Timestamp::getIncrement + + + + The increment component of a Timestamp is its least significant 32 bits, + whichs denotes the incrementing ordinal for operations within a given second. + This value is read as an unsigned 32-bit integer with big-endian byte order. + + &mongodb.note.uint32; + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the increment component of this Timestamp. + + + + On 32-bit systems this method may return a negative number. Although the + increment and timestamp parts of the BSON timestamp type consists of two + unsigned 32-bit values, PHP can not represent these on 32-bit platforms. + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + BSON Types: Timestamps + + + + + + diff --git a/reference/mongodb/bson/timestamp/gettimestamp.xml b/reference/mongodb/bson/timestamp/gettimestamp.xml new file mode 100644 index 0000000000..b5341c90d7 --- /dev/null +++ b/reference/mongodb/bson/timestamp/gettimestamp.xml @@ -0,0 +1,79 @@ + + + + + + + MongoDB\BSON\Timestamp::getTimestamp + timestamp component of this Timestamp を返す + + + + &reftitle.description; + + final public intMongoDB\BSON\Timestamp::getTimestamp + + + + The timestamp component of a Timestamp is its most significant 32 bits, which + denotes the number of seconds since the Unix epoch. This value is read as an + unsigned 32-bit integer with big-endian byte order. + + &mongodb.note.uint32; + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the timestamp component of this Timestamp. + + + + On 32-bit systems this method may return a negative number. Although the + increment and timestamp parts of the BSON timestamp type consists of two + unsigned 32-bit values, PHP can not represent these on 32-bit platforms. + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + BSON Types: Timestamps + + + + + + diff --git a/reference/mongodb/bson/timestamp/jsonserialize.xml b/reference/mongodb/bson/timestamp/jsonserialize.xml new file mode 100644 index 0000000000..c12b822f2f --- /dev/null +++ b/reference/mongodb/bson/timestamp/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\Timestamp::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\Timestamp::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\Timestamp. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/timestamp/tostring.xml b/reference/mongodb/bson/timestamp/tostring.xml new file mode 100644 index 0000000000..3fb4234444 --- /dev/null +++ b/reference/mongodb/bson/timestamp/tostring.xml @@ -0,0 +1,83 @@ + + + + + + + MongoDB\BSON\Timestamp::__toString + string representation of this Timestamp を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Timestamp::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this Timestamp. + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Timestamp::__toString</function> の例 + + +]]> + + &example.outputs.similar; + + + + + + + + + &reftitle.seealso; + + BSON Types: Timestamps + + + + + + diff --git a/reference/mongodb/bson/timestampinterface.xml b/reference/mongodb/bson/timestampinterface.xml new file mode 100644 index 0000000000..2d2ec79507 --- /dev/null +++ b/reference/mongodb/bson/timestampinterface.xml @@ -0,0 +1,78 @@ + + + + + + + MongoDB\BSON\TimestampInterface インターフェイス + MongoDB\BSON\TimestampInterface + + +
+ &reftitle.intro; + + This interface is implemented by + MongoDB\BSON\Timestamp to be used as a + parameter, return, or property type in userland classes. + +
+ +
+ &reftitle.classsynopsis; + + MongoDB\BSON\TimestampInterface + + + MongoDB\BSON\TimestampInterface + + + &Methods; + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + &mongodb.changelog.tentative-return-types; + + + + +
+
+ + &reference.mongodb.bson.entities.timestampinterface; + +
+ + diff --git a/reference/mongodb/bson/timestampinterface/getincrement.xml b/reference/mongodb/bson/timestampinterface/getincrement.xml new file mode 100644 index 0000000000..c746147687 --- /dev/null +++ b/reference/mongodb/bson/timestampinterface/getincrement.xml @@ -0,0 +1,66 @@ + + + + + + + MongoDB\BSON\TimestampInterface::getIncrement + increment component of this TimestampInterface を返す + + + + &reftitle.description; + + abstract public intMongoDB\BSON\TimestampInterface::getIncrement + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the increment component of this TimestampInterface. + + + + On 32-bit systems this method may return a negative number. Although the + increment and timestamp parts of the BSON timestamp type consists of two + unsigned 32-bit values, PHP can not represent these on 32-bit platforms. + + + + + + &reftitle.seealso; + + MongoDB\BSON\Timestamp::getIncrement + + + + + + diff --git a/reference/mongodb/bson/timestampinterface/gettimestamp.xml b/reference/mongodb/bson/timestampinterface/gettimestamp.xml new file mode 100644 index 0000000000..1f2551d5ad --- /dev/null +++ b/reference/mongodb/bson/timestampinterface/gettimestamp.xml @@ -0,0 +1,66 @@ + + + + + + + MongoDB\BSON\TimestampInterface::getTimestamp + timestamp component of this TimestampInterface を返す + + + + &reftitle.description; + + abstract public intMongoDB\BSON\TimestampInterface::getTimestamp + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the timestamp component of this TimestampInterface. + + + + On 32-bit systems this method may return a negative number. Although the + increment and timestamp parts of the BSON timestamp type consists of two + unsigned 32-bit values, PHP can not represent these on 32-bit platforms. + + + + + + &reftitle.seealso; + + MongoDB\BSON\Timestamp::getTimestamp + + + + + + diff --git a/reference/mongodb/bson/timestampinterface/tostring.xml b/reference/mongodb/bson/timestampinterface/tostring.xml new file mode 100644 index 0000000000..4fc3f828e9 --- /dev/null +++ b/reference/mongodb/bson/timestampinterface/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\TimestampInterface::__toString + string representation of this TimestampInterface を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\TimestampInterface::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this TimestampInterface. + + + + + &reftitle.seealso; + + MongoDB\BSON\Timestamp::__toString + + + + + + diff --git a/reference/mongodb/bson/type.xml b/reference/mongodb/bson/type.xml new file mode 100644 index 0000000000..1f4446c4fb --- /dev/null +++ b/reference/mongodb/bson/type.xml @@ -0,0 +1,69 @@ + + + + + + + MongoDB\BSON\Type インターフェイス + MongoDB\BSON\Type + + + + +
+ &reftitle.intro; + + Abstract base interface that should not be implemented directly. + +
+ + +
+ &reftitle.interfacesynopsis; + + + + MongoDB\BSON\Type + + + + + MongoDB\BSON\Type + + + + + + + + + This interface has no methods. Its only purpose is to be the base interface + for all BSON type classes. + + +
+ +
+ +
+ + diff --git a/reference/mongodb/bson/undefined.xml b/reference/mongodb/bson/undefined.xml new file mode 100644 index 0000000000..ab9f8b28f7 --- /dev/null +++ b/reference/mongodb/bson/undefined.xml @@ -0,0 +1,109 @@ + + + + + + + MongoDB\BSON\Undefined クラス + MongoDB\BSON\Undefined + + + + +
+ &reftitle.intro; + + BSON type for the "Undefined" type. This BSON type is deprecated, and this + class can not be instantiated. It will be created from a BSON undefined + type while converting BSON to PHP, and can also be converted back into + BSON while storing documents in the database. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\Undefined + + + + final + + MongoDB\BSON\Undefined + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.undefined; + +
+ + diff --git a/reference/mongodb/bson/undefined/construct.xml b/reference/mongodb/bson/undefined/construct.xml new file mode 100644 index 0000000000..414f9e31d7 --- /dev/null +++ b/reference/mongodb/bson/undefined/construct.xml @@ -0,0 +1,56 @@ + + + + + + + MongoDB\BSON\Undefined::__construct + 新しい Undefined (unused) を作成する + + + + &reftitle.description; + + final private MongoDB\BSON\Undefined::__construct + + + + MongoDB\BSON\Undefined objects are created through + conversion from a deprecated BSON type and cannot be constructed directly. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/undefined/jsonserialize.xml b/reference/mongodb/bson/undefined/jsonserialize.xml new file mode 100644 index 0000000000..a51e486a62 --- /dev/null +++ b/reference/mongodb/bson/undefined/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\Undefined::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\Undefined::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\Undefined. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/undefined/tostring.xml b/reference/mongodb/bson/undefined/tostring.xml new file mode 100644 index 0000000000..bf3625673a --- /dev/null +++ b/reference/mongodb/bson/undefined/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\Undefined::__toString + empty string を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\Undefined::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns an empty string. + + + + + &reftitle.seealso; + + BSON Types + + + + + + diff --git a/reference/mongodb/bson/unserializable.xml b/reference/mongodb/bson/unserializable.xml new file mode 100644 index 0000000000..415481cafe --- /dev/null +++ b/reference/mongodb/bson/unserializable.xml @@ -0,0 +1,89 @@ + + + + + + + MongoDB\BSON\Unserializable インターフェイス + MongoDB\BSON\Unserializable + + + + +
+ &reftitle.intro; + + Classes that implement this interface may be specified in a + type map for + unserializing BSON arrays and documents (both root and embedded). + +
+ + +
+ &reftitle.interfacesynopsis; + + + + MongoDB\BSON\Unserializable + + + + + MongoDB\BSON\Unserializable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + &mongodb.changelog.tentative-return-types; + + + + +
+
+ + &reference.mongodb.bson.entities.unserializable; + +
+ + diff --git a/reference/mongodb/bson/unserializable/bsonunserialize.xml b/reference/mongodb/bson/unserializable/bsonunserialize.xml new file mode 100644 index 0000000000..b8c9052414 --- /dev/null +++ b/reference/mongodb/bson/unserializable/bsonunserialize.xml @@ -0,0 +1,146 @@ + + + + + + + MongoDB\BSON\Unserializable::bsonUnserialize + BSON 配列またはドキュメントからオブジェクトを構築する + + + + &reftitle.description; + + abstract public voidMongoDB\BSON\Unserializable::bsonUnserialize + arraydata + + + Called during unserialization of the object from BSON. The properties of the + BSON array or document will be passed to the method as an array. + + + Remember to check for an _id property when handling data + from a BSON document. + + + + This method acts as the + constructor of the + object. The __construct() method + will not be called after this method. + + + + + + &reftitle.parameters; + + + data (array) + + + Properties within the BSON array or document. + + + + + + + + &reftitle.returnvalues; + + The return value from this method is ignored. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\Unserializable::bsonUnserialize</function> の例 + +data = $data; + } +} + +$bson = MongoDB\BSON\Document::fromJSON('{ "foo": "bar" }'); + +var_dump($bson->toPHP(['root' => 'MyDocument'])); + +?> +]]> + + &example.outputs; + + + array(1) { + ["foo"]=> + string(3) "bar" + } +} +]]> + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Serializable::bsonSerialize + MongoDB\BSON\Persistable + + + + + + + diff --git a/reference/mongodb/bson/utcdatetime.xml b/reference/mongodb/bson/utcdatetime.xml new file mode 100644 index 0000000000..26dc415070 --- /dev/null +++ b/reference/mongodb/bson/utcdatetime.xml @@ -0,0 +1,126 @@ + + + + + + + MongoDB\BSON\UTCDateTime クラス + MongoDB\BSON\UTCDateTime + + + + +
+ &reftitle.intro; + + Represents a + BSON date. The value + is a 64-bit integer that represents the number of milliseconds since the + Unix epoch (Jan 1, 1970). Negative values represent dates before 1970. + +
+ + +
+ &reftitle.classsynopsis; + + + + MongoDB\BSON\UTCDateTime + + + + final + + MongoDB\BSON\UTCDateTime + + + + MongoDB\BSON\UTCDateTimeInterface + + + + MongoDB\BSON\Type + + + + JsonSerializable + + + + Stringable + + + + + &Methods; + + + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.serializable-interface-removed; + + PECL mongodb 1.12.0 + + PHP 8.0 以降で Stringable を実装しました。 + + + + PECL mongodb 1.3.0 + + MongoDB\BSON\UTCDateTimeInterface を実装しました。 + + + + PECL mongodb 1.2.0 + + Implements Serializable and + JsonSerializable. + + + + + + +
+ +
+ + &reference.mongodb.bson.entities.utcdatetime; + +
+ + diff --git a/reference/mongodb/bson/utcdatetime/construct.xml b/reference/mongodb/bson/utcdatetime/construct.xml new file mode 100644 index 0000000000..cb1110d48a --- /dev/null +++ b/reference/mongodb/bson/utcdatetime/construct.xml @@ -0,0 +1,167 @@ + + + + + + + MongoDB\BSON\UTCDateTime::__construct + 新しい UTCDateTime を作成する + + + + &reftitle.description; + + final public MongoDB\BSON\UTCDateTime::__construct + intMongoDB\BSON\Int64DateTimeInterfacenullmilliseconds&null; + + + + + &reftitle.parameters; + + + milliseconds (intMongoDB\BSON\Int64DateTimeInterfacenull) + + + Number of milliseconds since the Unix epoch (Jan 1, 1970). Negative values + represent dates before 1970. This value may be provided as a 64-bit + int. For compatibility on 32-bit systems, this parameter + may also be provided as a MongoDB\BSON\Int64. + + + If the argument is a DateTimeInterface, the number + of milliseconds since the Unix epoch will be derived from that value. + + + If this argument is &null;, the current time will be used by default. + + + + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 2.0.0 + + + The milliseconds no longer accepts a + string or float argument. + + + + + PECL mongodb 1.20.0 + + + The milliseconds argument now accepts a + MongoDB\BSON\Int64 object (for compatibility on + 32-bit platforms). Specifying a string or + float is deprecated. + + + + + PECL mongodb 1.2.0 + + + The milliseconds argument is optional and + defaults to &null; (i.e. current time). The argument also accepts a + DateTimeInterface, which may be used to derive + the number of milliseconds since the Unix epoch. Previously, only + int, float, and string types + were accepted. + + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\UTCDateTime::__construct</function> の例 + + +]]> + + &example.outputs.similar; + + + string(13) "1484852905560" +} +object(MongoDB\BSON\UTCDateTime)#1 (1) { + ["milliseconds"]=> + string(13) "1484852905560" +} +object(MongoDB\BSON\UTCDateTime)#1 (1) { + ["milliseconds"]=> + string(13) "1416445411987" +} +]]> + + + + + + + &reftitle.seealso; + + BSON Types: Date + + + + + + diff --git a/reference/mongodb/bson/utcdatetime/jsonserialize.xml b/reference/mongodb/bson/utcdatetime/jsonserialize.xml new file mode 100644 index 0000000000..1ca149b1a5 --- /dev/null +++ b/reference/mongodb/bson/utcdatetime/jsonserialize.xml @@ -0,0 +1,73 @@ + + + + + + + MongoDB\BSON\UTCDateTime::jsonSerialize + representation that can be converted to JSON を返す + + + + &reftitle.description; + + final public mixedMongoDB\BSON\UTCDateTime::jsonSerialize + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns data which can be serialized by json_encode to + produce an extended JSON representation of the + MongoDB\BSON\UTCDateTime. + + &mongodb.note.extended-json; + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + JsonSerializable::jsonSerialize + json_encode + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + + + + + + diff --git a/reference/mongodb/bson/utcdatetime/todatetime.xml b/reference/mongodb/bson/utcdatetime/todatetime.xml new file mode 100644 index 0000000000..f0db0f79da --- /dev/null +++ b/reference/mongodb/bson/utcdatetime/todatetime.xml @@ -0,0 +1,104 @@ + + + + + + + MongoDB\BSON\UTCDateTime::toDateTime + DateTime representation of this UTCDateTime を返す + + + + &reftitle.description; + + final public DateTimeMongoDB\BSON\UTCDateTime::toDateTime + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the DateTime representation of this + UTCDateTime. The returned DateTime will use the UTC + time zone. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\UTCDatetime::toDateTime</function> の例 + +toDateTime(); +var_dump($datetime->format('r')); +var_dump($datetime->format('U.u')); +var_dump($datetime->getTimezone()); + +?> +]]> + + &example.outputs.similar; + + + int(1) + ["timezone"]=> + string(6) "+00:00" +} +]]> + + + + + + + &reftitle.seealso; + + MongoDB\BSON\UTCDateTime::toDateTimeImmutable + BSON Types: Date + + + + + + diff --git a/reference/mongodb/bson/utcdatetime/todatetimeimmutable.xml b/reference/mongodb/bson/utcdatetime/todatetimeimmutable.xml new file mode 100644 index 0000000000..9f241a08c8 --- /dev/null +++ b/reference/mongodb/bson/utcdatetime/todatetimeimmutable.xml @@ -0,0 +1,104 @@ + + + + + + + MongoDB\BSON\UTCDateTime::toDateTimeImmutable + DateTimeImmutable representation of this UTCDateTime を返す + + + + &reftitle.description; + + final public DateTimeImmutableMongoDB\BSON\UTCDateTime::toDateTimeImmutable + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the DateTimeImmutable representation of this + UTCDateTime. The returned DateTimeImmutable will use the UTC + time zone. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\UTCDatetime::toDateTimeImmutable</function> の例 + +toDateTimeImmutable(); +var_dump($datetime->format('r')); +var_dump($datetime->format('U.u')); +var_dump($datetime->getTimezone()); + +?> +]]> + + &example.outputs.similar; + + + int(1) + ["timezone"]=> + string(6) "+00:00" +} +]]> + + + + + + + &reftitle.seealso; + + MongoDB\BSON\UTCDateTime::toDateTime + BSON Types: Date + + + + + + diff --git a/reference/mongodb/bson/utcdatetime/tostring.xml b/reference/mongodb/bson/utcdatetime/tostring.xml new file mode 100644 index 0000000000..1e32ab4467 --- /dev/null +++ b/reference/mongodb/bson/utcdatetime/tostring.xml @@ -0,0 +1,83 @@ + + + + + + + MongoDB\BSON\UTCDateTime::__toString + string representation of this UTCDateTime を返す + + + + &reftitle.description; + + final public stringMongoDB\BSON\UTCDateTime::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this UTCDateTime. + + + + + &reftitle.examples; + + <function>MongoDB\BSON\UTCDateTime::__toString</function> の例 + + +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + BSON Types: Date + + + + + + diff --git a/reference/mongodb/bson/utcdatetimeinterface.xml b/reference/mongodb/bson/utcdatetimeinterface.xml new file mode 100644 index 0000000000..709f80c097 --- /dev/null +++ b/reference/mongodb/bson/utcdatetimeinterface.xml @@ -0,0 +1,78 @@ + + + + + + + MongoDB\BSON\UTCDateTimeInterface インターフェイス + MongoDB\BSON\UTCDateTimeInterface + + +
+ &reftitle.intro; + + This interface is implemented by + MongoDB\BSON\UTCDateTime to be used as a + parameter, return, or property type in userland classes. + +
+ +
+ &reftitle.classsynopsis; + + MongoDB\BSON\UTCDateTimeInterface + + + MongoDB\BSON\UTCDateTimeInterface + + + &Methods; + + +
+ +
+ &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.tentative-return-types-enforced; + &mongodb.changelog.tentative-return-types; + + + + +
+
+ + &reference.mongodb.bson.entities.utcdatetimeinterface; + +
+ + diff --git a/reference/mongodb/bson/utcdatetimeinterface/todatetime.xml b/reference/mongodb/bson/utcdatetimeinterface/todatetime.xml new file mode 100644 index 0000000000..81dfbb9b4f --- /dev/null +++ b/reference/mongodb/bson/utcdatetimeinterface/todatetime.xml @@ -0,0 +1,61 @@ + + + + + + + MongoDB\BSON\UTCDateTimeInterface::toDateTime + DateTime representation of this UTCDateTimeInterface を返す + + + + &reftitle.description; + + abstract public DateTimeMongoDB\BSON\UTCDateTimeInterface::toDateTime + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the DateTime representation of this + UTCDateTimeInterface. The returned DateTime should use + the UTC time zone. + + + + + &reftitle.seealso; + + MongoDB\BSON\UTCDateTime::toDateTime + + + + + + diff --git a/reference/mongodb/bson/utcdatetimeinterface/todatetimeimmutable.xml b/reference/mongodb/bson/utcdatetimeinterface/todatetimeimmutable.xml new file mode 100644 index 0000000000..e69fe61121 --- /dev/null +++ b/reference/mongodb/bson/utcdatetimeinterface/todatetimeimmutable.xml @@ -0,0 +1,61 @@ + + + + + + + MongoDB\BSON\UTCDateTimeInterface::toDateTimeImmutable + DateTimeImmutable representation of this UTCDateTimeInterface を返す + + + + &reftitle.description; + + abstract public DateTimeImmutableMongoDB\BSON\UTCDateTimeInterface::toDateTimeImmutable + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the DateTimeImmutable representation of this + UTCDateTimeInterface. The returned DateTimeImmutable will use the UTC + time zone. + + + + + &reftitle.seealso; + + MongoDB\BSON\UTCDateTime::toDateTimeImmutable + + + + + + diff --git a/reference/mongodb/bson/utcdatetimeinterface/tostring.xml b/reference/mongodb/bson/utcdatetimeinterface/tostring.xml new file mode 100644 index 0000000000..1ae3f27238 --- /dev/null +++ b/reference/mongodb/bson/utcdatetimeinterface/tostring.xml @@ -0,0 +1,59 @@ + + + + + + + MongoDB\BSON\UTCDateTimeInterface::__toString + string representation of this UTCDateTimeInterface を返す + + + + &reftitle.description; + + abstract public stringMongoDB\BSON\UTCDateTimeInterface::__toString + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the string representation of this UTCDateTimeInterface. + + + + + &reftitle.seealso; + + MongoDB\BSON\UTCDateTime::__toString + + + + + + diff --git a/reference/mongodb/bson/vectortype.xml b/reference/mongodb/bson/vectortype.xml new file mode 100644 index 0000000000..42af5daed1 --- /dev/null +++ b/reference/mongodb/bson/vectortype.xml @@ -0,0 +1,71 @@ + + + + + + + MongoDB\BSON\VectorType 列挙型 + MongoDB\BSON\VectorType + + +
+ &reftitle.intro; + + The MongoDB\BSON\VectorType enum is used to specify the type of + vector data stored in a MongoDB\BSON\Binary with + subtype MongoDB\BSON\Binary::TYPE_VECTOR. + +
+ +
+ &reftitle.enumsynopsis; + + + MongoDB\BSON\VectorType + + + Float32 + + Each element in the vector is a 32-bit floating point value. + + + + + Int8 + + Each element in the vector is an 8-bit integer value. + + + + + PackedBit + + Each element in the vector is a 1-bit value. When creating vectors of this + type, you may pass either bool or 1-bit int values, i.e. 0 or 1. + + + +
+
+
+ + diff --git a/reference/mongodb/configure.xml b/reference/mongodb/configure.xml new file mode 100644 index 0000000000..5775d625b9 --- /dev/null +++ b/reference/mongodb/configure.xml @@ -0,0 +1,318 @@ + + + + +
+ &reftitle.install; + +
+ PIE を使った MongoDB PHP 拡張モジュールのインストール + + &pecl.moving.to.pie; + + + PIE を使用して MongoDB 拡張モジュールをインストールするには、次のコマンドを実行します: + + + + + +
+ +
+ PECL を使った MongoDB PHP 拡張モジュールのインストール + + + &pecl.info; + &url.pecl.package;mongodb + + + + Linux、Unix、macOS のユーザーは、次のコマンドを実行して拡張モジュールをインストールできます: + + + + + + + 複数のバージョンの PHP がインストールされているシステム (e.g. macOS default, + Homebrew, XAMPP), では、各バージョンの PHP に独自の pecl + コマンドと &php.ini; ファイルがあります。 また、各 PHP 環境 (CLI、Web など) は別々の &php.ini; ファイルを使用する場合があります。 + + + + As of extension version 1.17.0, PECL will prompt for various + configure options. To install the extension with default + options in a non-interactive script, empty string input may be piped to + pecl install using the yes command: + + + + + + + A complete list of supported configure options can be + found in the package.xml file included in the PECL + package. To install the extension with specific configure + options in a non-interactive script, the + --configureoptions option for + pecl install may be used: + + + + + + + By default, installing the extension via PECL will use bundled versions of + libbson, + libmongoc, and + libmongocrypt and attempt to + automatically configure them. + + + + + If the build process fails to find an SSL library, check that the + development packages (e.g. libssl-dev) and + pkg-config are both + installed. If that does not resolve the problem, consider using the + manual installation + process. + + + + + 最後に、拡張モジュールを使用する必要がある各環境の &php.ini; ファイルに次の行を追加します: + + + + +
+ +
+ Homebrew を使った macOS での MongoDB PHP 拡張モジュールのインストール + + + Homebrew 1.5.0 + deprecated the Homebrew/php tap + and removed formulae for individual PHP extensions. Going forward, macOS + users are advised to install the + php formula + and follow the standard + PECL installation instructions + using the pecl command provided by the + Homebrew PHP installation. + + + Alternatively, the + shivammathur/extensions tap + provides formulae for individual PHP extensions. For example, to install the + extension for PHP 8.4, run: + + + + Please note that only the latest extension version is available in brew. + + + 必要な依存パッケージのインストール + + To ensure that SSL support can be configured correctly, make sure that the + openssl and pkgconf formulae are + installed. If either of these packages are missing, the extension will be + compiled with Secure Transport, which can lead to compatibility issues. + + +
+ +
+ Windows での MongoDB PHP 拡張モジュールのインストール + + + Precompiled binaries are attached to the project's + Github リリースに添付されています。PHP のバージョン、スレッドセーフティ (TS または NTS)、アーキテクチャ (x86 または x64) のさまざまな組み合わせのアーカイブが公開されています。 Determining the correct archive + for the PHP environment and extract the php_mongodb.dll + file to the extension directory ("ext" by default). + + + + 拡張モジュールを使用する必要がある各環境の &php.ini; ファイルに次の行を追加します: + + + + + + + 正しいバイナリを選択しないと、実行時に拡張モジュール DLL の読み込みを試みる際にエラーが発生します: + + + + + + + ダウンロードした DLL が以下の PHP ランタイムプロパティに対応していることを確認してください: + + PHP バージョン (PHP_VERSION) + スレッドセーフティ (PHP_ZTS) + アーキテクチャ (PHP_INT_SIZE) + + + + + 前述の定数に加えて、これらのプロパティは phpinfo からも推測できます。 システムに複数の PHP ランタイムがインストールされている場合は、phpinfo の出力が正しい環境のものであることを再確認してください。 + + + + Windows ユーザー向けの追加 DLL 依存関係 + + &ext.windows.path.dll; + libsasl.dll + + +
+ +
+ MongoDB PHP ドライバのソースからのビルド + + + For developers and users interested in the latest bugfixes, the extension + may be compiled from the latest source code on + Github. Run the following + commands to clone and build the project: + + + + + + + 複数のバージョンの PHP がインストールされているシステム (e.g. macOS default, + Homebrew, XAMPP), では、各バージョンの PHP に独自の phpize + コマンドと &php.ini; ファイルがあります。 また、各 PHP 環境 (CLI、Web など) は別々の &php.ini; ファイルを使用する場合があります。 + + + + By default, the extension will use bundled versions of + libbson, + libmongoc, and + libmongocrypt and + attempt to configure them automatically. If these libraries are already + installed as system libraries, the extension can utilize them by + specifying --with-mongodb-system-libs=yes as an option to + configure. + + + + For a complete list of configure options, run + configure --help. + + + + When using bundled versions of libmongoc and libmongocrypt, the extension + will also attempt to select an SSL library according to the + --with-mongodb-ssl configure option. + As of extension version 1.17.0, OpenSSL is always preferred by default. + Previously, Secure Transport was the default on macOS and OpenSSL was the + default on all other platforms. + + + + + If the build process fails to find an SSL library, check that the + development packages (e.g. libssl-dev) and + pkg-config are both + installed. + + + + When using Homebrew on macOS, it is common for a system to have multiple + versions of OpenSSL installed. To ensure that the desired version of OpenSSL + is selected, the PKG_CONFIG_PATH environment variable may + be used to control the search path for pkg-config. + + + + + The final build step, make install, will report where + mongodb.so has been installed, similar to: + + + + + + + Ensure that the extension_dir option + in &php.ini; points to the directory where mongodb.so + was installed. The option may be queried by running: + + /usr/lib/php/extensions/debug-non-zts-20220829 => + /usr/lib/php/extensions/debug-non-zts-20220829 +]]> + + + + + If the directories differ, either change + extension_dir in &php.ini; or + manually move mongodb.so to the correct directory. + + + + 最後に、拡張モジュールを使用する必要がある各環境の &php.ini; ファイルに次の行を追加します: + + + + +
+ +
+ + + diff --git a/reference/mongodb/constants.xml b/reference/mongodb/constants.xml new file mode 100644 index 0000000000..fe47d29912 --- /dev/null +++ b/reference/mongodb/constants.xml @@ -0,0 +1,55 @@ + + + + + + &reftitle.constants; + &extension.constants; + + + + + MONGODB_VERSION + (string) + + + + 拡張モジュールの x.y.z 形式のバージョン番号 + + + + + + MONGODB_STABILITY + (string) + + + + 現在の安定性 (alpha/beta/stable) + + + + + + + + diff --git a/reference/mongodb/exceptions.xml b/reference/mongodb/exceptions.xml new file mode 100644 index 0000000000..9958109043 --- /dev/null +++ b/reference/mongodb/exceptions.xml @@ -0,0 +1,72 @@ + + + + + + MongoDB\Driver\Exception + 例外クラス + + &reference.mongodb.mongodb.driver.exception.authenticationexception; + &reference.mongodb.mongodb.driver.exception.bulkwriteexception; + &reference.mongodb.mongodb.driver.exception.bulkwritecommandexception; + &reference.mongodb.mongodb.driver.exception.commandexception; + &reference.mongodb.mongodb.driver.exception.connectionexception; + &reference.mongodb.mongodb.driver.exception.connectiontimeoutexception; + &reference.mongodb.mongodb.driver.exception.encryptionexception; + &reference.mongodb.mongodb.driver.exception.exception; + &reference.mongodb.mongodb.driver.exception.executiontimeoutexception; + &reference.mongodb.mongodb.driver.exception.invalidargumentexception; + &reference.mongodb.mongodb.driver.exception.logicexception; + &reference.mongodb.mongodb.driver.exception.runtimeexception; + &reference.mongodb.mongodb.driver.exception.serverexception; + &reference.mongodb.mongodb.driver.exception.sslconnectionexception; + &reference.mongodb.mongodb.driver.exception.unexpectedvalueexception; + &reference.mongodb.mongodb.driver.exception.writeexception; + +
+ Class Tree + MongoDB Exception Class Tree + + + The class hierarchy for MongoDB exceptions is modeled after that of the + SPL Exceptions. Base classes extend + their SPL counterpart and all exception classes in the extension implement + the MongoDB\Driver\Exception\Exception interface. + + + + MongoDB\Driver\Exception\LogicException (extends LogicException) + MongoDB\Driver\Exception\InvalidArgumentException (extends InvalidArgumentException) + MongoDB\Driver\Exception\UnexpectedValueException (extends UnexpectedValueException) + + MongoDB\Driver\Exception\RuntimeException (extends RuntimeException) + + + MongoDB\Driver\Exception\ConnectionException + + MongoDB\Driver\Exception\AuthenticationException + MongoDB\Driver\Exception\ConnectionTimeoutException + MongoDB\Driver\Exception\SSLConnectionException (deprecated) + + + MongoDB\Driver\Exception\EncryptionException + + MongoDB\Driver\Exception\ServerException + + MongoDB\Driver\Exception\BulkWriteCommandException + MongoDB\Driver\Exception\CommandException + MongoDB\Driver\Exception\ExecutionTimeoutException + + MongoDB\Driver\Exception\WriteException (deprecated) + + MongoDB\Driver\Exception\BulkWriteException + + + + + + + +
+ +
diff --git a/reference/mongodb/functions/bson/fromjson.xml b/reference/mongodb/functions/bson/fromjson.xml new file mode 100644 index 0000000000..593d6b6344 --- /dev/null +++ b/reference/mongodb/functions/bson/fromjson.xml @@ -0,0 +1,148 @@ + + + + + + + MongoDB\BSON\fromJSON + BSON representation of a JSON value を返す + + + + + + This function has been DEPRECATED as of extension + version 1.20.0 and was removed in 2.0. Applications should use + MongoDB\BSON\Document::fromJSON instead. + + + + + + &reftitle.description; + + stringMongoDB\BSON\fromJSON + stringjson + + + Converts an + extended JSON + string to its BSON representation. + + + + + &reftitle.parameters; + + + json (string) + + + JSON value to be converted. + + + + + + + + &reftitle.returnvalues; + + The serialized BSON document as a binary string. + + + + + &reftitle.errors; + + + Throws + MongoDB\Driver\Exception\UnexpectedValueException if + the JSON value cannot be converted to BSON (e.g. due to a syntax error). + + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.function-removed; + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\fromJSON</function> の例 + + +]]> + + &example.outputs; + + + object(MongoDB\BSON\ObjectId)#1 (1) { + ["oid"]=> + string(24) "563143b280d2387c91807965" + } +} +]]> + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromJSON + MongoDB\BSON\toJSON + MongoDB Extended JSON + MongoDB BSON + + + + + + diff --git a/reference/mongodb/functions/bson/fromphp.xml b/reference/mongodb/functions/bson/fromphp.xml new file mode 100644 index 0000000000..ec3da0d33d --- /dev/null +++ b/reference/mongodb/functions/bson/fromphp.xml @@ -0,0 +1,144 @@ + + + + + + + MongoDB\BSON\fromPHP + BSON representation of a PHP value を返す + + + + + + This function has been DEPRECATED as of extension + version 1.20.0 and was removed in 2.0. Applications should use + MongoDB\BSON\Document::fromPHP instead. + + + + + + &reftitle.description; + + stringMongoDB\BSON\fromPHP + arrayobjectvalue + + + Serializes a PHP array or object (e.g. document) to its + BSON representation. The + returned binary string will describe a BSON document. + + + + + &reftitle.parameters; + + + value (arrayobject) + + + PHP value to be serialized. + + + + + + + + &reftitle.returnvalues; + + The serialized BSON document as a binary string. + + + + + &reftitle.errors; + + + Throws + MongoDB\Driver\Exception\UnexpectedValueException if + the PHP value cannot be converted to BSON. Possible reasons include, but are + not limited to, encountering an unexpected + MongoDB\BSON\Type instance or + MongoDB\BSON\Serializable::bsonSerialize failing to + return an array or stdClass. + + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.function-removed; + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\fromPHP</function> の例 + + 1]); +echo bin2hex($bson), "\n"; + +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromPHP + MongoDB\BSON\toPHP + MongoDB BSON + + + + + + + diff --git a/reference/mongodb/functions/bson/tocanonicalextendedjson.xml b/reference/mongodb/functions/bson/tocanonicalextendedjson.xml new file mode 100644 index 0000000000..2cd6f3b4bd --- /dev/null +++ b/reference/mongodb/functions/bson/tocanonicalextendedjson.xml @@ -0,0 +1,187 @@ + + + + + + + MongoDB\BSON\toCanonicalExtendedJSON + Canonical Extended JSON representation of a BSON value を返す + + + + + + This function has been DEPRECATED as of extension + version 1.20.0 and was removed in 2.0. Applications should use + MongoDB\BSON\Document::toCanonicalExtendedJSON + instead. + + + + + + &reftitle.description; + + stringMongoDB\BSON\toCanonicalExtendedJSON + stringbson + + + Converts a BSON string to its + Canonical Extended JSON + representation. The canonical format prefers type fidelity at the expense of + concise output and is most suited for producing output that can be converted + back to BSON without any loss of type information (e.g. numeric types will + remain differentiated). + + + + + &reftitle.parameters; + + + bson (string) + + + BSON value to be converted. + + + + + + + + &reftitle.returnvalues; + + The converted JSON value. + + + + + &reftitle.errors; + + &mongodb.throws.bson.unexpected; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.function-removed; + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\toCanonicalExtendedJSON</function> の例 + + null ], + [ 'boolean' => true ], + [ 'string' => 'foo' ], + [ 'int32' => 123 ], + [ 'int64' => 4294967295 ], + [ 'double' => 1.0, ], + [ 'nan' => NAN ], + [ 'pos_inf' => INF ], + [ 'neg_inf' => -INF ], + [ 'array' => [ 'foo', 'bar' ]], + [ 'document' => [ 'foo' => 'bar' ]], + [ 'oid' => new MongoDB\BSON\ObjectId('56315a7c6118fd1b920270b1') ], + [ 'dec128' => new MongoDB\BSON\Decimal128('1234.5678') ], + [ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ], + [ 'date' => new MongoDB\BSON\UTCDateTime(1445990400000) ], + [ 'timestamp' => new MongoDB\BSON\Timestamp(1234, 5678) ], + [ 'regex' => new MongoDB\BSON\Regex('pattern', 'i') ], + [ 'code' => new MongoDB\BSON\Javascript('function() { return 1; }') ], + [ 'code_ws' => new MongoDB\BSON\Javascript('function() { return a; }', ['a' => 1]) ], + [ 'minkey' => new MongoDB\BSON\MinKey ], + [ 'maxkey' => new MongoDB\BSON\MaxKey ], +]; + +foreach ($documents as $document) { + $bson = MongoDB\BSON\fromPHP($document); + echo MongoDB\BSON\toCanonicalExtendedJSON($bson), "\n"; +} + +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromJSON + MongoDB\BSON\Document::toCanonicalExtendedJSON + MongoDB\BSON\fromJSON + MongoDB\BSON\toRelaxedExtendedJSON + Extended JSON Specification + MongoDB BSON + + + + + + diff --git a/reference/mongodb/functions/bson/tojson.xml b/reference/mongodb/functions/bson/tojson.xml new file mode 100644 index 0000000000..55871f6c5f --- /dev/null +++ b/reference/mongodb/functions/bson/tojson.xml @@ -0,0 +1,212 @@ + + + + + + + MongoDB\BSON\toJSON + Legacy Extended JSON representation of a BSON value を返す + + + + + + This function has been DEPRECATED as of extension + version 1.20.0 and was removed in 2.0. Applications should use + MongoDB\BSON\Document::toCanonicalExtendedJSON or + MongoDB\BSON\Document::toRelaxedExtendedJSON + instead. + + + + + + &reftitle.description; + + stringMongoDB\BSON\toJSON + stringbson + + + Converts a BSON string to its + Legacy Extended JSON + representation. + + + + There exist several JSON formats for representing BSON. This function + implements the "strict mode" defined in + MongoDB Extended JSON, + which has been superseded by the canonical and relaxed formats defined in + the + Extended JSON Specification + and implemented by MongoDB\BSON\toCanonicalExtendedJSON + and MongoDB\BSON\toRelaxedExtendedJSON, respectively. + + + + + JSON does not support + NAN and + INF and + MongoDB's Legacy Extended JSON format does not define an alternative + representation for these values + (libbson will output + nan and inf literals, which may not be + parsed as valid JSON). If you are working with BSON that may contain + non-finite numbers, please use + MongoDB\BSON\toCanonicalExtendedJSON or + MongoDB\BSON\toRelaxedExtendedJSON. + + + + + + &reftitle.parameters; + + + bson (string) + + + BSON value to be converted. + + + + + + + + &reftitle.returnvalues; + + The converted JSON value. + + + + + &reftitle.errors; + + &mongodb.throws.bson.unexpected; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.function-removed; + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\toJSON</function> の例 + + null ], + [ 'boolean' => true ], + [ 'string' => 'foo' ], + [ 'int32' => 123 ], + [ 'int64' => 4294967295 ], + [ 'double' => 1.0, ], + [ 'nan' => NAN ], + [ 'pos_inf' => INF ], + [ 'neg_inf' => -INF ], + [ 'array' => [ 'foo', 'bar' ]], + [ 'document' => [ 'foo' => 'bar' ]], + [ 'oid' => new MongoDB\BSON\ObjectId('56315a7c6118fd1b920270b1') ], + [ 'dec128' => new MongoDB\BSON\Decimal128('1234.5678') ], + [ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ], + [ 'date' => new MongoDB\BSON\UTCDateTime(1445990400000) ], + [ 'timestamp' => new MongoDB\BSON\Timestamp(1234, 5678) ], + [ 'regex' => new MongoDB\BSON\Regex('pattern', 'i') ], + [ 'code' => new MongoDB\BSON\Javascript('function() { return 1; }') ], + [ 'code_ws' => new MongoDB\BSON\Javascript('function() { return a; }', ['a' => 1]) ], + [ 'minkey' => new MongoDB\BSON\MinKey ], + [ 'maxkey' => new MongoDB\BSON\MaxKey ], +]; + +foreach ($documents as $document) { + $bson = MongoDB\BSON\fromPHP($document); + echo MongoDB\BSON\toJSON($bson), "\n"; +} + +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\fromJSON + MongoDB\BSON\toCanonicalExtendedJSON + MongoDB\BSON\toRelaxedExtendedJSON + MongoDB Extended JSON + MongoDB BSON + + + + + + diff --git a/reference/mongodb/functions/bson/tophp.xml b/reference/mongodb/functions/bson/tophp.xml new file mode 100644 index 0000000000..ec84f91a8a --- /dev/null +++ b/reference/mongodb/functions/bson/tophp.xml @@ -0,0 +1,181 @@ + + + + + + + MongoDB\BSON\toPHP + PHP representation of a BSON value を返す + + + + + + This function has been DEPRECATED as of extension + version 1.20.0 and was removed in 2.0. Applications should use + MongoDB\BSON\Document::toPHP instead. + + + + + + &reftitle.description; + + arrayobjectMongoDB\BSON\toPHP + stringbson + arraytypeMaparray() + + + Unserializes a BSON document (i.e. binary string) to its PHP representation. + The typeMap paramater may be used to control the PHP + types used for converting BSON arrays and documents (both root and embedded). + + &mongodb.warning.duplicate-keys; + + + + &reftitle.parameters; + + + bson (string) + + + BSON value to be unserialized. + + + + &mongodb.parameter.typeMap; + + + + + &reftitle.returnvalues; + + The unserialized PHP value. + + + + + &reftitle.errors; + + + 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; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.function-removed; + + PECL mongodb 1.4.0 + + + If the input contains an unsupported, deprecated BSON type, the + extension will now no longer log a warning to the debug log, but instead + will create an object representing this type. + + + + + PECL mongodb 1.3.2 + + + MongoDB\Driver\Exception\UnexpectedValueException + is no longer thrown if the input contains an unsupported, deprecated + BSON type. Such types will be ignored (as they were in versions before + 1.3.0), although the extension will now log a warning to the debug log + (see: mongodb.debug). + + + + + PECL mongodb 1.3.0 + + + MongoDB\Driver\Exception\UnexpectedValueException + is thrown if the input contains an unsupported, deprecated BSON type. + Previously, such types were ignored. + + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\toPHP</function> の例 + + +]]> + + &example.outputs; + + + int(1) +} +]]> + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::toPHP + MongoDB\BSON\fromPHP + MongoDB BSON + + + + + + + diff --git a/reference/mongodb/functions/bson/torelaxedextendedjson.xml b/reference/mongodb/functions/bson/torelaxedextendedjson.xml new file mode 100644 index 0000000000..2d8a78cd57 --- /dev/null +++ b/reference/mongodb/functions/bson/torelaxedextendedjson.xml @@ -0,0 +1,186 @@ + + + + + + + MongoDB\BSON\toRelaxedExtendedJSON + Relaxed Extended JSON representation of a BSON value を返す + + + + + + This function has been DEPRECATED as of extension + version 1.20.0 and was removed in 2.0. Applications should use + MongoDB\BSON\Document::toRelaxedExtendedJSON + instead. + + + + + + &reftitle.description; + + stringMongoDB\BSON\toRelaxedExtendedJSON + stringbson + + + Converts a BSON string to its + Relaxed Extended JSON + representation. The relaxed format prefers use of JSON type primitives at the + expense of type fidelity and is most suited for producing output that can be + easily consumed by web APIs and humans. + + + + + &reftitle.parameters; + + + bson (string) + + + BSON value to be converted. + + + + + + + + &reftitle.returnvalues; + + The converted JSON value. + + + + + &reftitle.errors; + + &mongodb.throws.bson.unexpected; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + &mongodb.changelog.function-removed; + + + + + + + + &reftitle.examples; + + <function>MongoDB\BSON\toRelaxedExtendedJSON</function> の例 + + null ], + [ 'boolean' => true ], + [ 'string' => 'foo' ], + [ 'int32' => 123 ], + [ 'int64' => 4294967295 ], + [ 'double' => 1.0, ], + [ 'nan' => NAN ], + [ 'pos_inf' => INF ], + [ 'neg_inf' => -INF ], + [ 'array' => [ 'foo', 'bar' ]], + [ 'document' => [ 'foo' => 'bar' ]], + [ 'oid' => new MongoDB\BSON\ObjectId('56315a7c6118fd1b920270b1') ], + [ 'dec128' => new MongoDB\BSON\Decimal128('1234.5678') ], + [ 'binary' => new MongoDB\BSON\Binary('foo', MongoDB\BSON\Binary::TYPE_GENERIC) ], + [ 'date' => new MongoDB\BSON\UTCDateTime(1445990400000) ], + [ 'timestamp' => new MongoDB\BSON\Timestamp(1234, 5678) ], + [ 'regex' => new MongoDB\BSON\Regex('pattern', 'i') ], + [ 'code' => new MongoDB\BSON\Javascript('function() { return 1; }') ], + [ 'code_ws' => new MongoDB\BSON\Javascript('function() { return a; }', ['a' => 1]) ], + [ 'minkey' => new MongoDB\BSON\MinKey ], + [ 'maxkey' => new MongoDB\BSON\MaxKey ], +]; + +foreach ($documents as $document) { + $bson = MongoDB\BSON\fromPHP($document); + echo MongoDB\BSON\toRelaxedExtendedJSON($bson), "\n"; +} + +?> +]]> + + &example.outputs; + + + + + + + + &reftitle.seealso; + + MongoDB\BSON\Document::fromJSON + MongoDB\BSON\Document::toRelaxedExtendedJSON + MongoDB\BSON\fromJSON + MongoDB\BSON\toCanonicalExtendedJSON + Extended JSON + MongoDB BSON + + + + + + diff --git a/reference/mongodb/functions/driver/monitoring/addsubscriber.xml b/reference/mongodb/functions/driver/monitoring/addsubscriber.xml new file mode 100644 index 0000000000..0dfd089521 --- /dev/null +++ b/reference/mongodb/functions/driver/monitoring/addsubscriber.xml @@ -0,0 +1,91 @@ + + + + + + + MongoDB\Driver\Monitoring\addSubscriber + モニタリングイベントサブスクライバーをグローバルに登録する + + + + &reftitle.description; + + voidMongoDB\Driver\Monitoring\addSubscriber + MongoDB\Driver\Monitoring\Subscribersubscriber + + + Registers a monitoring event subscriber globally. The subscriber will be + notified of all events in the extension for any Manager. + + + + If subscriber is already registered globally, this + function is a no-op. If subscriber is also registered + with one or more Managers, it will still only be notified once of each event + for each Manager. + + + + + + &reftitle.parameters; + + + subscriber (MongoDB\Driver\Monitoring\Subscriber) + + + A monitoring event subscriber to register globally. + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + MongoDB\Driver\Monitoring\removeSubscriber + MongoDB\Driver\Monitoring\Subscriber + MongoDB\Driver\Monitoring\CommandSubscriber + MongoDB\Driver\Manager::addSubscriber + + + + + + + diff --git a/reference/mongodb/functions/driver/monitoring/removesubscriber.xml b/reference/mongodb/functions/driver/monitoring/removesubscriber.xml new file mode 100644 index 0000000000..601414938a --- /dev/null +++ b/reference/mongodb/functions/driver/monitoring/removesubscriber.xml @@ -0,0 +1,88 @@ + + + + + + + MongoDB\Driver\Monitoring\removeSubscriber + モニタリングイベントサブスクライバーのグローバルな登録を解除する + + + + &reftitle.description; + + voidMongoDB\Driver\Monitoring\removeSubscriber + MongoDB\Driver\Monitoring\Subscribersubscriber + + + Unregisters a monitoring event subscriber globally. + + + + If subscriber is not already registered globally, + this function is a no-op. + + + + + + &reftitle.parameters; + + + subscriber (MongoDB\Driver\Monitoring\Subscriber) + + + A monitoring event subscriber to unregister globally. + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.seealso; + + MongoDB\Driver\Monitoring\addSubscriber + MongoDB\Driver\Monitoring\Subscriber + MongoDB\Driver\Monitoring\CommandSubscriber + MongoDB\Driver\Manager::removeSubscriber + + + + + + + diff --git a/reference/mongodb/images/driver_arch.svg b/reference/mongodb/images/driver_arch.svg new file mode 100644 index 0000000000..a978d2cbbe --- /dev/null +++ b/reference/mongodb/images/driver_arch.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/reference/mongodb/ini.xml b/reference/mongodb/ini.xml new file mode 100644 index 0000000000..7f4c7dc949 --- /dev/null +++ b/reference/mongodb/ini.xml @@ -0,0 +1,90 @@ + + + + +
+ &reftitle.runtime; + &extension.runtime; + + + mongodb &ConfigureOptions; + + + + &Name; + &Default; + &Changeable; + &Changelog; + + + + + mongodb.debug + "" + INI_ALL + + + + +
+
+ + &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; + + public MongoDB\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; + + + +
+
+
+
+
+
+ + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 1.14.0 + + Added the "comment" and "let" + options. + + + + PECL mongodb 1.1.0 + + Added the "bypassDocumentValidation" option. + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWrite::__construct</function> の例 + + true]); +$bulk->delete([]); +$bulk->insert(['_id' => 1, 'x' => 1]); +$bulk->insert(['_id' => 2, 'x' => 2]); +$bulk->update( + ['x' => 2], + ['$set' => ['x' => 1]], + ['limit' => 1, 'upsert' => false] +); +$bulk->delete(['x' => 1], ['limit' => 1]); +$bulk->update( + ['_id' => 3], + ['$set' => ['x' => 3]], + ['limit' => 1, 'upsert' => true] +); + +$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017'); +$writeConcern = new MongoDB\Driver\WriteConcern(1); + +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()); +printf("Upserted %d document(s)\n", $result->getUpsertedCount()); +printf("Deleted %d document(s)\n", $result->getDeletedCount()); + +?> +]]> + + &example.outputs; + + + + + + + + + &reftitle.seealso; + + MongoDB\Driver\Manager::executeBulkWrite + MongoDB\Driver\WriteResult + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/bulkwrite/count.xml b/reference/mongodb/mongodb/driver/bulkwrite/count.xml new file mode 100644 index 0000000000..5da36b7d4d --- /dev/null +++ b/reference/mongodb/mongodb/driver/bulkwrite/count.xml @@ -0,0 +1,121 @@ + + + + + + + MongoDB\Driver\BulkWrite::count + 一括操作内の書き込み操作の数を数える + + + + &reftitle.description; + + public intMongoDB\Driver\BulkWrite::count + + + + Returns the number of write operations added to the + MongoDB\Driver\BulkWrite object. + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns number of write operations added to the + MongoDB\Driver\BulkWrite object. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 1.2.0 + + Returns the number of write operations added to the + MongoDB\Driver\BulkWrite object. Earlier versions + returned the expected number of client-to-server roundtrips required to + execute all write operations. + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWrite::count</function> の例 + +insert(['_id' => 1, 'x' => 1]); +$bulk->insert(['_id' => 2, 'x' => 2]); +$bulk->update(['x' => 2], ['$set' => ['x' => 1]]); +$bulk->delete(['x' => 1]); + +var_dump(count($bulk)); + +?> +]]> + + &example.outputs; + + + + + + + + + + diff --git a/reference/mongodb/mongodb/driver/bulkwrite/delete.xml b/reference/mongodb/mongodb/driver/bulkwrite/delete.xml new file mode 100644 index 0000000000..0887a20c57 --- /dev/null +++ b/reference/mongodb/mongodb/driver/bulkwrite/delete.xml @@ -0,0 +1,172 @@ + + + + + + + MongoDB\Driver\BulkWrite::delete + 一括操作に削除操作を追加する + + + + &reftitle.description; + + public voidMongoDB\Driver\BulkWrite::delete + arrayobjectfilter + arraynulldeleteOptions&null; + + + Adds a delete operation to the + MongoDB\Driver\BulkWrite. + + + + + + &reftitle.parameters; + + &mongodb.parameter.filter; + + deleteOptions + + + + 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; + + + +
+
+
+
+
+
+ + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 1.8.0 + + Added the "hint" option. + + + + PECL mongodb 1.2.0 + + Added the "collation" option. + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWrite::delete</function> の例 + +delete(['x' => 1], ['limit' => 1]); +$bulk->delete(['x' => 2], ['limit' => 0]); + +$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/bulkwrite/insert.xml b/reference/mongodb/mongodb/driver/bulkwrite/insert.xml new file mode 100644 index 0000000000..37ea6c50fa --- /dev/null +++ b/reference/mongodb/mongodb/driver/bulkwrite/insert.xml @@ -0,0 +1,156 @@ + + + + + + + MongoDB\Driver\BulkWrite::insert + 一括操作に挿入操作を追加する + + + + &reftitle.description; + + public mixedMongoDB\Driver\BulkWrite::insert + arrayobjectdocument + + + Adds an insert operation to the + MongoDB\Driver\BulkWrite. + + + + + + &reftitle.parameters; + + + 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.changelog; + + + + + + &Version; + &Description; + + + + + PECL mongodb 1.3.0 + + The _id of the inserted document is always returned. + Previously, the method only returned a value if a + MongoDB\BSON\ObjectId was generated. + + + + + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWrite::insert</function> の例 + + 1]; +$doc2 = ['_id' => 'custom-id', 'x' => 2]; +$doc3 = ['_id' => new MongoDB\BSON\ObjectId('0123456789abcdef01234567'), 'x' => 3]; + +$id1 = $bulk->insert($doc1); +$id2 = $bulk->insert($doc2); +$id3 = $bulk->insert($doc3); + +var_dump($id1, $id2, $id3); + +$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017'); +$result = $manager->executeBulkWrite('db.collection', $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::executeBulkWrite + MongoDB\Driver\WriteResult + MongoDB\BSON\ObjectId + MongoDB\BSON\Persistable + + + + + + diff --git a/reference/mongodb/mongodb/driver/bulkwrite/update.xml b/reference/mongodb/mongodb/driver/bulkwrite/update.xml new file mode 100644 index 0000000000..1b16eff49d --- /dev/null +++ b/reference/mongodb/mongodb/driver/bulkwrite/update.xml @@ -0,0 +1,268 @@ + + + + + + + MongoDB\Driver\BulkWrite::update + 一括操作に更新操作を追加する + + + + &reftitle.description; + + public voidMongoDB\Driver\BulkWrite::update + arrayobjectfilter + arrayobjectnewObj + arraynullupdateOptions&null; + + + Adds an update operation to the + MongoDB\Driver\BulkWrite. + + + + + + &reftitle.parameters; + + &mongodb.parameter.filter; + + newObj (arrayobject) + + + A document containing either update operators (e.g. + $set), a replacement document (i.e. + only field:value expressions), or + an aggregation pipeline. + + + + + updateOptions + + + + 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; + + <function>MongoDB\Driver\BulkWrite::update</function> の例 + +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; + + public MongoDB\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; + + + +
+
+
+
+
+
+ + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWriteCommand::__construct</function> の例 + +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; + + + + + + + + &reftitle.seealso; + + MongoDB\Driver\Manager::executeBulkWriteCommand + MongoDB\Driver\BulkWriteCommandResult + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/bulkwritecommand/count.xml b/reference/mongodb/mongodb/driver/bulkwritecommand/count.xml new file mode 100644 index 0000000000..30bca0d169 --- /dev/null +++ b/reference/mongodb/mongodb/driver/bulkwritecommand/count.xml @@ -0,0 +1,93 @@ + + + + + + + MongoDB\Driver\BulkWriteCommand::count + BulkWriteCommand 内の書き込み操作の数を数える + + + + &reftitle.description; + + public intMongoDB\Driver\BulkWriteCommand::count + + + + Returns the number of write operations added to the + MongoDB\Driver\BulkWriteCommand object. + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns number of write operations added to the + MongoDB\Driver\BulkWriteCommand object. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWriteCommand::count</function> の例 + +insertOne('db.coll', ['_id' => 1, 'x' => 1]); +$bulk->insertOne('db.coll', ['_id' => 2, 'x' => 2]); +$bulk->updateOne('db.coll', ['x' => 2], ['$set' => ['x' => 1]]); +$bulk->deleteMany('db.coll', ['x' => 1]); + +var_dump(count($bulk)); + +?> +]]> + + &example.outputs; + + + + + + + + + diff --git a/reference/mongodb/mongodb/driver/bulkwritecommand/deletemany.xml b/reference/mongodb/mongodb/driver/bulkwritecommand/deletemany.xml new file mode 100644 index 0000000000..d1058197ae --- /dev/null +++ b/reference/mongodb/mongodb/driver/bulkwritecommand/deletemany.xml @@ -0,0 +1,134 @@ + + + + + + + MongoDB\Driver\BulkWriteCommand::deleteMany + deleteMany 操作を追加する + + + + &reftitle.description; + + public voidMongoDB\Driver\BulkWriteCommand::deleteMany + stringnamespace + arrayobjectfilter + arraynulloptions&null; + + + Add a deleteMany operation to the + MongoDB\Driver\BulkWriteCommand. All documents + matching filter in the collection identified by + namespace will be deleted. + + + + + &reftitle.parameters; + + &mongodb.parameter.namespace; + &mongodb.parameter.filter; + + 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. + + + + + +
+
+
+
+
+
+ + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWriteCommand::deleteMany</function> の例 + +deleteMany('db.coll', ['x' => ['$gt' => 1]]); + +$result = $manager->executeBulkWriteCommand($bulk); + +?> +]]> + + + + + + &reftitle.seealso; + + MongoDB\Driver\BulkWriteCommand::deleteOne + MongoDB\Driver\Manager::executeBulkWriteCommand + MongoDB\Driver\BulkWriteCommandResult + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/bulkwritecommand/deleteone.xml b/reference/mongodb/mongodb/driver/bulkwritecommand/deleteone.xml new file mode 100644 index 0000000000..06e8fcbbb0 --- /dev/null +++ b/reference/mongodb/mongodb/driver/bulkwritecommand/deleteone.xml @@ -0,0 +1,134 @@ + + + + + + + MongoDB\Driver\BulkWriteCommand::deleteOne + deleteOne 操作を追加する + + + + &reftitle.description; + + public voidMongoDB\Driver\BulkWriteCommand::deleteOne + stringnamespace + arrayobjectfilter + arraynulloptions&null; + + + Add a deleteOne operation to the + MongoDB\Driver\BulkWriteCommand. The first document + matching filter in the collection identified by + namespace will be deleted. + + + + + &reftitle.parameters; + + &mongodb.parameter.namespace; + &mongodb.parameter.filter; + + 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. + + + + + +
+
+
+
+
+
+ + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWriteCommand::deleteOne</function> の例 + +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; + + public mixedMongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommand::insertOne</function> の例 + + 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; + + public voidMongoDB\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; + + + +
+
+
+
+
+
+ + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWriteCommand::replaceOne</function> の例 + +replaceOne('db.coll', ['x' => 1], ['x' => 1, 'y' = 2]); + +$result = $manager->executeBulkWriteCommand($bulk); + +?> +]]> + + + + + + &reftitle.seealso; + + MongoDB\Driver\BulkWriteCommand::updateOne + MongoDB\Driver\BulkWriteCommand::updateMany + MongoDB\Driver\Manager::executeBulkWriteCommand + MongoDB\Driver\BulkWriteCommandResult + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/bulkwritecommand/updatemany.xml b/reference/mongodb/mongodb/driver/bulkwritecommand/updatemany.xml new file mode 100644 index 0000000000..6e9123e6da --- /dev/null +++ b/reference/mongodb/mongodb/driver/bulkwritecommand/updatemany.xml @@ -0,0 +1,170 @@ + + + + + + + MongoDB\Driver\BulkWriteCommand::updateMany + updateMany 操作を追加する + + + + &reftitle.description; + + public voidMongoDB\Driver\BulkWriteCommand::updateMany + stringnamespace + arrayobjectfilter + arrayobjectupdate + arraynulloptions&null; + + + Add an updateMany operation to the + MongoDB\Driver\BulkWriteCommand. All documents + matching filter in the collection identified by + namespace will be updated. + + + + + + &reftitle.parameters; + + &mongodb.parameter.namespace; + &mongodb.parameter.filter; + + update (arrayobject) + + + A document containing either update operators (e.g. + $set) or an + aggregation pipeline. + + + + + options + + + + 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; + + + +
+
+
+
+
+
+ + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + &reftitle.examples; + + <function>MongoDB\Driver\BulkWriteCommand::updateMany</function> の例 + +updateMany('db.coll', ['x' => ['$gt' => 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/bulkwritecommand/updateone.xml b/reference/mongodb/mongodb/driver/bulkwritecommand/updateone.xml new file mode 100644 index 0000000000..a3f3ece083 --- /dev/null +++ b/reference/mongodb/mongodb/driver/bulkwritecommand/updateone.xml @@ -0,0 +1,181 @@ + + + + + + + MongoDB\Driver\BulkWriteCommand::updateOne + updateOne 操作を追加する + + + + &reftitle.description; + + public voidMongoDB\Driver\BulkWriteCommand::updateOne + stringnamespace + arrayobjectfilter + arrayobjectupdate + arraynulloptions&null; + + + Add an updateOne operation to the + MongoDB\Driver\BulkWriteCommand. The first document + matching filter in the collection identified by + namespace will be updated. + + + + + + &reftitle.parameters; + + &mongodb.parameter.namespace; + &mongodb.parameter.filter; + + update (arrayobject) + + + A document containing either update operators (e.g. + $set) or an + aggregation pipeline. + + + + + options + + + + 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; + + <function>MongoDB\Driver\BulkWriteCommand::updateOne</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommandResult::getDeletedCount</function> の例 + +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; + + final public MongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommandResult::getDeleteResults</function> の例 + + 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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommandResult::getInsertedCount</function> の例 + +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; + + final public MongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommandResult::getInsertResults</function> の例 + + 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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommandResult::getMatchedCount</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommandResult::getModifiedCount</function> の例 + +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; + + final public MongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommandResult::getUpdateResults</function> の例 + + 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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommandResult::getUpsertedCount</function> の例 + +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; + + final public boolMongoDB\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; + + <function>MongoDB\Driver\BulkWriteCommandResult::isAcknowledged</function> with acknowledged write concern + +insertOne('db.coll', ['x' => 1]); + +$result = $manager->executeBulkWriteCommand($bulk); + +var_dump($result->isAcknowledged()); + +?> +]]> + + &example.outputs; + + + + + + <function>MongoDB\Driver\BulkWriteCommandResult::isAcknowledged</function> 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..0e85ef6934 --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption.xml @@ -0,0 +1,257 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + 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..cb3875430a --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/addkeyaltname.xml @@ -0,0 +1,92 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::addKeyAltName + キードキュメントに代替名を追加する + + + + &reftitle.description; + + final public objectnullMongoDB\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; + + final public MongoDB\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..70fc4d5d9d --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/createdatakey.xml @@ -0,0 +1,171 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::createDataKey + キードキュメントを作成する + + + + &reftitle.description; + + final public MongoDB\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..178cb87420 --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/decrypt.xml @@ -0,0 +1,81 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::decrypt + 値を復号する + + + + &reftitle.description; + + final public mixedMongoDB\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..74a0b0f626 --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/deletekey.xml @@ -0,0 +1,74 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::deleteKey + キードキュメントを削除する + + + + &reftitle.description; + + final public objectMongoDB\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..65fc2f73da --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/encrypt.xml @@ -0,0 +1,122 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::encrypt + 値を暗号化する + + + + &reftitle.description; + + final public MongoDB\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..6cdd4b4336 --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/encryptexpression.xml @@ -0,0 +1,142 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::encryptExpression + マッチ式または集約式を暗号化する + + + + &reftitle.description; + + final public objectMongoDB\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..67b1359bf3 --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/getkey.xml @@ -0,0 +1,73 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::getKey + キードキュメントを取得する + + + + &reftitle.description; + + final public objectnullMongoDB\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..e99f40a933 --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/getkeybyaltname.xml @@ -0,0 +1,80 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::getKeyByAltName + 代替名でキードキュメントを取得する + + + + &reftitle.description; + + final public objectnullMongoDB\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..360657d76d --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/getkeys.xml @@ -0,0 +1,60 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::getKeys + すべてのキードキュメントを取得する + + + + &reftitle.description; + + final public MongoDB\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..60e072a3d7 --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/removekeyaltname.xml @@ -0,0 +1,92 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::removeKeyAltName + キードキュメントから代替名を削除する + + + + &reftitle.description; + + final public objectnullMongoDB\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..b26964481d --- /dev/null +++ b/reference/mongodb/mongodb/driver/clientencryption/rewrapmanydatakey.xml @@ -0,0 +1,151 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ClientEncryption::rewrapManyDataKey + データキーを再ラップする + + + + &reftitle.description; + + final public objectMongoDB\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 <classname>MongoDB\Driver\Command</classname> 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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Command::__construct</function> の例 + + 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) +} + +]]> + + + + + <function>MongoDB\Driver\Command::__construct</function> の例 + + 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; + + final private MongoDB\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..522d83b1e9 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursor/current.xml @@ -0,0 +1,58 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Cursor::current + current element を返す + + + + &reftitle.description; + + public arrayobjectnullMongoDB\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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Cursor::getId</function> の例 + + 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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Cursor::getServer</function> の例 + +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; + + final public boolMongoDB\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; + + <function>MongoDB\Driver\Cursor::isDead</function> の例 + +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..c0ecd6619e --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursor/key.xml @@ -0,0 +1,56 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Cursor::key + current result の index within the cursor を返す + + + + &reftitle.description; + + public intMongoDB\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..8b62bd6f58 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursor/next.xml @@ -0,0 +1,63 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Cursor::next + カーソルを次の結果に進める + + + + &reftitle.description; + + public voidMongoDB\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..b7183d3bab --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursor/rewind.xml @@ -0,0 +1,68 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Cursor::rewind + カーソルを最初の結果に巻き戻す + + + + &reftitle.description; + + public voidMongoDB\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..9c167f4c40 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursor/settypemap.xml @@ -0,0 +1,130 @@ + + + + + + + MongoDB\Driver\Cursor::setTypeMap + BSON のデシリアライズに使用する型マップを設定する + + + + &reftitle.description; + + final public voidMongoDB\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; + + <function>MongoDB\Driver\Cursor::setTypeMap</function> の例 + +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; + + final public arrayMongoDB\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; + + <function>MongoDB\Driver\Cursor::toArray</function> の例 + +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..7601d11991 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursor/valid.xml @@ -0,0 +1,56 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Cursor::valid + the current position in the cursor is valid かどうかを調べる + + + + &reftitle.description; + + public boolMongoDB\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; + + final private MongoDB\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; + + final public stringMongoDB\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; + + <function>MongoDB\Driver\CursorId::__toString</function> の例 + + 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..c003b9cce7 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursorinterface.xml @@ -0,0 +1,104 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + 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..6d0c0d49c8 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursorinterface/getid.xml @@ -0,0 +1,98 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\CursorInterface::getId + ID for this cursor を返す + + + + &reftitle.description; + + abstract public MongoDB\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..4bc09770a2 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursorinterface/getserver.xml @@ -0,0 +1,74 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\CursorInterface::getServer + server associated with this cursor を返す + + + + &reftitle.description; + + abstract public MongoDB\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..804dca0256 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursorinterface/isdead.xml @@ -0,0 +1,79 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\CursorInterface::isDead + the cursor may have additional results かどうかを調べる + + + + &reftitle.description; + + abstract public boolMongoDB\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..fcab9bba79 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml @@ -0,0 +1,74 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\CursorInterface::setTypeMap + BSON のデシリアライズに使用する型マップを設定する + + + + &reftitle.description; + + abstract public voidMongoDB\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..c9acbbeaa7 --- /dev/null +++ b/reference/mongodb/mongodb/driver/cursorinterface/toarray.xml @@ -0,0 +1,72 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\CursorInterface::toArray + array containing all results for this cursor を返す + + + + &reftitle.description; + + abstract public arrayMongoDB\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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Exception\BulkWriteCommandException::getErrorReply</function> の例 + +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; + + final public MongoDB\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; + + final public arrayMongoDB\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; + + <function>MongoDB\Driver\Exception\BulkWriteCommandException::getWriteConcernErrors</function> の例 + +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; + + final public arrayMongoDB\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; + + <function>MongoDB\Driver\Exception\BulkWriteCommandException::getWriteErrors</function> の例 + + 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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Exception\BulkWriteException::getWriteResult</function> の例 + +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; + + final public objectMongoDB\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..7cd729335d --- /dev/null +++ b/reference/mongodb/mongodb/driver/exception/encryptionexception.xml @@ -0,0 +1,82 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + 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; + + final public boolMongoDB\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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Exception\WriteException::getWriteResult</function> の例 + +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; + + + <function>MongoDB\Driver\Manager::__construct</function> 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; + + final public voidMongoDB\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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Manager::__construct</function> 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..24163009b3 --- /dev/null +++ b/reference/mongodb/mongodb/driver/manager/createclientencryption.xml @@ -0,0 +1,167 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Manager::createClientEncryption + 新しい ClientEncryption object を作成する + + + + &reftitle.description; + + final public MongoDB\Driver\ClientEncryptionMongoDB\Driver\Manager::createClientEncryption + arrayoptions + + + Constructs a new MongoDB\Driver\ClientEncryption object with the specified options. + + + + + &reftitle.parameters; + + + options + + + + options + + + + Option + Type + Description + + + + &mongodb.option.encryption.keyVaultClient; + &mongodb.option.encryption.keyVaultNamespace; + &mongodb.option.encryption.kmsProviders; + &mongodb.option.encryption.tlsOptions; + + +
+
+
+
+
+
+ + + &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; + + final public MongoDB\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 + + + + options + + + + Option + Type + Description + + + + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+
+
+
+
+ + + &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.examples; + + <function>MongoDB\Driver\Manager::executeBulkWrite</function> の例 + +insert(['_id' => 1, 'x' => 1]); +$bulk->insert(['_id' => 2, 'x' => 2]); + +$bulk->update(['x' => 2], ['$set' => ['x' => 1]], ['multi' => false, 'upsert' => false]); +$bulk->update(['x' => 3], ['$set' => ['x' => 3]], ['multi' => false, 'upsert' => true]); +$bulk->update(['_id' => 3], ['$set' => ['x' => 3]], ['multi' => false, 'upsert' => true]); + +$bulk->insert(['_id' => 4, 'x' => 2]); + +$bulk->delete(['x' => 1], ['limit' => 1]); + +$manager = new MongoDB\Driver\Manager('mongodb://localhost:27017'); +$writeConcern = new MongoDB\Driver\WriteConcern(MongoDB\Driver\WriteConcern::MAJORITY, 100); +$result = $manager->executeBulkWrite('db.collection', $bulk, ['writeConcern' => $writeConcern]); + +printf("Inserted %d document(s)\n", $result->getInsertedCount()); +printf("Matched %d document(s)\n", $result->getMatchedCount()); +printf("Updated %d document(s)\n", $result->getModifiedCount()); +printf("Upserted %d document(s)\n", $result->getUpsertedCount()); +printf("Deleted %d document(s)\n", $result->getDeletedCount()); + +foreach ($result->getUpsertedIds() as $index => $id) { + printf('upsertedId[%d]: ', $index); + var_dump($id); +} + +/* If the WriteConcern could not be fulfilled */ +if ($writeConcernError = $result->getWriteConcernError()) { + printf("%s (%d): %s\n", $writeConcernError->getMessage(), $writeConcernError->getCode(), var_export($writeConcernError->getInfo(), true)); +} + +/* If a write could not happen at all */ +foreach ($result->getWriteErrors() as $writeError) { + printf("Operation#%d: %s (%d)\n", $writeError->getIndex(), $writeError->getMessage(), $writeError->getCode()); +} +?> +]]> + + &example.outputs.similar; + + + string(24) "54d3adc3ce7a792f4d703756" +} +upsertedId[4]: int(3) +]]> + + + + + + &reftitle.seealso; + + MongoDB\Driver\BulkWrite + MongoDB\Driver\WriteResult + MongoDB\Driver\WriteConcern + MongoDB\Driver\Server::executeBulkWrite + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/manager/executebulkwritecommand.xml b/reference/mongodb/mongodb/driver/manager/executebulkwritecommand.xml new file mode 100644 index 0000000000..70b57d9b57 --- /dev/null +++ b/reference/mongodb/mongodb/driver/manager/executebulkwritecommand.xml @@ -0,0 +1,212 @@ + + + + + + + MongoDB\Driver\Manager::executeBulkWriteCommand + bulkWrite コマンドを使用して書き込み操作を実行する + + + + &reftitle.description; + + final public MongoDB\Driver\BulkWriteCommandResultMongoDB\Driver\Manager::executeBulkWriteCommand + MongoDB\Driver\BulkWriteCommandbulk + arraynulloptions&null; + + + Executes one or more write operations on the primary 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 + + + + options + + + + Option + Type + Description + + + + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+
+
+
+
+ + + &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.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\BulkWriteCommand + MongoDB\Driver\BulkWriteCommandResult + MongoDB\Driver\WriteConcern + MongoDB\Driver\Server::executeBulkWriteCommand + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/manager/executecommand.xml b/reference/mongodb/mongodb/driver/manager/executecommand.xml new file mode 100644 index 0000000000..fcdf9f1a0b --- /dev/null +++ b/reference/mongodb/mongodb/driver/manager/executecommand.xml @@ -0,0 +1,317 @@ + + + + + + + MongoDB\Driver\Manager::executeCommand + データベースコマンドを実行する + + + + &reftitle.description; + + final public MongoDB\Driver\CursorMongoDB\Driver\Manager::executeCommand + stringdb + MongoDB\Driver\Commandcommand + arraynulloptions&null; + + + Selects a server according to the "readPreference" option + and executes the command on that 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. + + + + + &reftitle.parameters; + + &mongodb.parameter.db; + &mongodb.parameter.command; + + options + + + + options + + + + Option + Type + Description + + + + &mongodb.option.readConcern; + &mongodb.option.readPreference; + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+ &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; + + <function>MongoDB\Driver\Manager::executeCommand</function> 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) +} +]]> + + + + <function>MongoDB\Driver\Manager::executeCommand</function> 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; + + final public MongoDB\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 + + + + options + + + + Option + Type + Description + + + + &mongodb.option.readPreference; + &mongodb.option.session; + + +
+
+
+
+
+
+ + + &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; + + <function>MongoDB\Driver\Manager::executeQuery</function> の例 + +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; + + final public MongoDB\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 + + + + options + + + + Option + Type + Description + + + + &mongodb.option.readConcern; + &mongodb.option.readPreference; + &mongodb.option.session; + + +
+
+ &mongodb.option.transactionReadWriteConcern; +
+
+
+
+ + + &reftitle.returnvalues; + &mongodb.returns.cursor; + + + + &reftitle.errors; + + &mongodb.throws.session-readwriteconcern; + &mongodb.throws.std; + Throws MongoDB\Driver\Exception\RuntimeException on other errors (e.g. invalid command). + + + + + &reftitle.seealso; + + MongoDB\Driver\Command + MongoDB\Driver\Cursor + MongoDB\Driver\Manager::executeCommand + MongoDB\Driver\Manager::executeReadWriteCommand + MongoDB\Driver\Manager::executeWriteCommand + MongoDB\Driver\Server::executeReadCommand + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/manager/executereadwritecommand.xml b/reference/mongodb/mongodb/driver/manager/executereadwritecommand.xml new file mode 100644 index 0000000000..d03faa565b --- /dev/null +++ b/reference/mongodb/mongodb/driver/manager/executereadwritecommand.xml @@ -0,0 +1,139 @@ + + + + + + + MongoDB\Driver\Manager::executeReadWriteCommand + 読み書きを行うデータベースコマンドを実行する + + + + &reftitle.description; + + final public MongoDB\Driver\CursorMongoDB\Driver\Manager::executeReadWriteCommand + stringdb + MongoDB\Driver\Commandcommand + arraynulloptions&null; + + + Executes the command on the primary server. + + + This method will apply logic that is specific to commands that read and write + (e.g. aggregate). + Default values for the "readConcern" and + "writeConcern" 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 + + + + options + + + + Option + Type + Description + + + + &mongodb.option.readConcern; + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+ &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::executeWriteCommand + MongoDB\Driver\Server::executeReadWriteCommand + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/manager/executewritecommand.xml b/reference/mongodb/mongodb/driver/manager/executewritecommand.xml new file mode 100644 index 0000000000..d98da2bc31 --- /dev/null +++ b/reference/mongodb/mongodb/driver/manager/executewritecommand.xml @@ -0,0 +1,149 @@ + + + + + + + MongoDB\Driver\Manager::executeWriteCommand + 書き込みを行うデータベースコマンドを実行する + + + + &reftitle.description; + + final public MongoDB\Driver\CursorMongoDB\Driver\Manager::executeWriteCommand + stringdb + MongoDB\Driver\Commandcommand + arraynulloptions&null; + + + Executes the command on the primary server. + + + This method will apply logic that is specific to commands that write (e.g. + drop). + The default value for the "writeConcern" option will be + inferred from an active transaction (indicated by the + "session" option), followed by the + connection URI. + + + + This method is not intended to be used to execute + insert, + update, + or delete + commands. Users are encouraged to use + MongoDB\Driver\Manager::executeBulkWrite for those + operations. + + + + + + &reftitle.parameters; + + &mongodb.parameter.db; + &mongodb.parameter.command; + + options + + + + options + + + + Option + Type + Description + + + + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+ &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; + + final public arrayobjectnullMongoDB\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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Manager::getReadConcern</function> の例 + +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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Manager::getReadPreference</function> の例 + +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; + + final public arrayMongoDB\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; + + <function>MongoDB\Driver\Manager::getServers</function> の例 + +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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Manager::getWriteConcern</function> の例 + +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; + + final public voidMongoDB\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; + + final public MongoDB\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; + + final public MongoDB\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. + + +
+ options + + + + Option + Type + Description + + + + &mongodb.option.maxCommitTimeMS; + &mongodb.option.readConcern; + &mongodb.option.readPreference; + &mongodb.option.writeConcern; + + +
+
+ + 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; + + final public stringMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public ExceptionMongoDB\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; + + final public stringMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public objectMongoDB\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; + + final public stringMongoDB\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; + + final public MongoDB\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; + + final public intnullMongoDB\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; + + final public MongoDB\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; + + final public objectMongoDB\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; + + final public stringMongoDB\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; + + final public stringMongoDB\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; + + final public stringMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public stringMongoDB\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; + + final public MongoDB\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; + + final public intnullMongoDB\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; + + final public MongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + final public stringMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public stringMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public objectMongoDB\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; + + final public stringMongoDB\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; + + final public MongoDB\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; + + final public intnullMongoDB\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; + + final public MongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + abstract public voidMongoDB\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; + + final public stringMongoDB\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; + + final public MongoDB\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; + + final public intMongoDB\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; + + final public MongoDB\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; + + final public MongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public MongoDB\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; + + final public intMongoDB\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; + + final public ExceptionMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public boolMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public boolMongoDB\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; + + final public intMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public objectMongoDB\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; + + final public boolMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public MongoDB\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; + + final public MongoDB\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; + + final public MongoDB\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; + + final public MongoDB\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; + + final public MongoDB\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; + + final public MongoDB\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; + + final public MongoDB\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; + + <function>MongoDB\Driver\Query::__construct</function> の例 + + '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; + + final public stdClassMongoDB\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; + + <function>MongoDB\Driver\ReadConcern::bsonSerialize</function> with empty read concern + +bsonSerialize()); + +echo "\n", MongoDB\BSON\Document::fromPHP($rc)->toRelaxedExtendedJSON(); + +?> +]]> + + &example.outputs.similar; + + + + + <function>MongoDB\Driver\ReadConcern::bsonSerialize</function> 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; + + final public MongoDB\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; + + <function>MongoDB\Driver\ReadConcern::__construct</function> の例 + + +]]> + + + + + + + &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; + + final public stringnullMongoDB\Driver\ReadConcern::getLevel + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the ReadConcern's "level" option. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\ReadConcern::getLevel</function> の例 + +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; + + final public boolMongoDB\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; + + <function>MongoDB\Driver\ReadConcern::isDefault</function> の例 + +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; + + final public stdClassMongoDB\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; + + <function>MongoDB\Driver\ReadPreference::bsonSerialize</function> with primary read preference + +bsonSerialize()); + +echo "\n", MongoDB\BSON\Document::fromPHP($rp)->toRelaxedExtendedJSON(); + +?> +]]> + + &example.outputs.similar; + + + string(7) "primary" +} + +{ "mode" : "primary" } +]]> + + + + <function>MongoDB\Driver\ReadPreference::bsonSerialize</function> 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" }, { } ] } +]]> + + + + <function>MongoDB\Driver\ReadPreference::bsonSerialize</function> 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; + + final public MongoDB\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; + + <function>MongoDB\Driver\ReadPreference::__construct</function> の例 + + '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..016d2a55f4 --- /dev/null +++ b/reference/mongodb/mongodb/driver/readpreference/gethedge.xml @@ -0,0 +1,67 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ReadPreference::getHedge + ReadPreference の "hedge" option を返す + + + + &reftitle.description; + + final public objectnullMongoDB\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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\ReadPreference::getMaxStalenessSeconds</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\ReadPreference::getMode</function> の例 + +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..bd39e89660 --- /dev/null +++ b/reference/mongodb/mongodb/driver/readpreference/getmodestring.xml @@ -0,0 +1,108 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\ReadPreference::getModeString + ReadPreference の "mode" option を返す + + + + &reftitle.description; + + final public stringMongoDB\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; + + <function>MongoDB\Driver\ReadPreference::getModeString</function> の例 + +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; + + final public arrayMongoDB\Driver\ReadPreference::getTagSets + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the ReadPreference's "tagSets" option. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\ReadPreference::getTagSets</function> の例 + +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; + + final private MongoDB\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; + + final public MongoDB\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 + + + + options + + + + Option + Type + Description + + + + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+
+
+
+
+ + + &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; + + final public MongoDB\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 + + + + options + + + + Option + Type + Description + + + + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+
+
+
+
+ + + &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; + + final public MongoDB\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 + + + + options + + + + Option + Type + Description + + + + &mongodb.option.readConcern; + &mongodb.option.readPreference; + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+ &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.notes; + &mongodb.note.server.write; + + + + &reftitle.seealso; + + MongoDB\Driver\Command + MongoDB\Driver\Cursor + MongoDB\Driver\Server::executeReadCommand + MongoDB\Driver\Server::executeReadWriteCommand + MongoDB\Driver\Server::executeWriteCommand + MongoDB\Driver\Manager::executeCommand + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/server/executequery.xml b/reference/mongodb/mongodb/driver/server/executequery.xml new file mode 100644 index 0000000000..6f1cd109ec --- /dev/null +++ b/reference/mongodb/mongodb/driver/server/executequery.xml @@ -0,0 +1,146 @@ + + + + + + + MongoDB\Driver\Server::executeQuery + このサーバー上でデータベースクエリを実行する + + + + &reftitle.description; + + final public MongoDB\Driver\CursorMongoDB\Driver\Server::executeQuery + stringnamespace + MongoDB\Driver\Queryquery + arraynulloptions&null; + + + Executes the query on this 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. + + &mongodb.note.server.readpreference; + + + + &reftitle.parameters; + + &mongodb.parameter.namespace; + &mongodb.parameter.query; + + options + + + + options + + + + Option + Type + Description + + + + &mongodb.option.readPreference; + &mongodb.option.session; + + +
+
+
+
+
+
+ + + &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.seealso; + + MongoDB\Driver\Cursor + MongoDB\Driver\Query + MongoDB\Driver\ReadPreference + MongoDB\Driver\Manager::executeQuery + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/server/executereadcommand.xml b/reference/mongodb/mongodb/driver/server/executereadcommand.xml new file mode 100644 index 0000000000..d816b58b3f --- /dev/null +++ b/reference/mongodb/mongodb/driver/server/executereadcommand.xml @@ -0,0 +1,114 @@ + + + + + + + MongoDB\Driver\Server::executeReadCommand + このサーバー上で読み取りを行うデータベースコマンドを実行する + + + + &reftitle.description; + + final public MongoDB\Driver\CursorMongoDB\Driver\Server::executeReadCommand + stringdb + MongoDB\Driver\Commandcommand + arraynulloptions&null; + + + Executes the command on this server, irrespective of the + "readPreference" option. + + + 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. + + &mongodb.note.server.readpreference; + + + + &reftitle.parameters; + + &mongodb.parameter.db; + &mongodb.parameter.command; + + options + + + + options + + + + Option + Type + Description + + + + &mongodb.option.readConcern; + &mongodb.option.readPreference; + &mongodb.option.session; + + +
+
+ &mongodb.option.transactionReadWriteConcern; +
+
+
+
+ + + &reftitle.returnvalues; + &mongodb.returns.cursor; + + + + &reftitle.errors; + + &mongodb.throws.session-readwriteconcern; + &mongodb.throws.std; + Throws MongoDB\Driver\Exception\RuntimeException on other errors (e.g. invalid command). + + + + + &reftitle.seealso; + + MongoDB\Driver\Command + MongoDB\Driver\Cursor + MongoDB\Driver\Server::executeCommand + MongoDB\Driver\Server::executeReadWriteCommand + MongoDB\Driver\Server::executeWriteCommand + MongoDB\Driver\Manager::executeReadCommand + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/server/executereadwritecommand.xml b/reference/mongodb/mongodb/driver/server/executereadwritecommand.xml new file mode 100644 index 0000000000..80335e1509 --- /dev/null +++ b/reference/mongodb/mongodb/driver/server/executereadwritecommand.xml @@ -0,0 +1,144 @@ + + + + + + + MongoDB\Driver\Server::executeReadWriteCommand + このサーバー上で読み書きを行うデータベースコマンドを実行する + + + + &reftitle.description; + + final public MongoDB\Driver\CursorMongoDB\Driver\Server::executeReadWriteCommand + stringdb + MongoDB\Driver\Commandcommand + arraynulloptions&null; + + + Executes the command on this server. + + + This method will apply logic that is specific to commands that read and write + (e.g. aggregate). + Default values for the "readConcern" and + "writeConcern" 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 + + + + options + + + + Option + Type + Description + + + + &mongodb.option.readConcern; + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+ &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::executeWriteCommand + MongoDB\Driver\Manager::executeReadWriteCommand + + + +
+ + diff --git a/reference/mongodb/mongodb/driver/server/executewritecommand.xml b/reference/mongodb/mongodb/driver/server/executewritecommand.xml new file mode 100644 index 0000000000..a0d737bbdb --- /dev/null +++ b/reference/mongodb/mongodb/driver/server/executewritecommand.xml @@ -0,0 +1,154 @@ + + + + + + + MongoDB\Driver\Server::executeWriteCommand + このサーバー上で書き込みを行うデータベースコマンドを実行する + + + + &reftitle.description; + + final public MongoDB\Driver\CursorMongoDB\Driver\Server::executeWriteCommand + stringdb + MongoDB\Driver\Commandcommand + arraynulloptions&null; + + + Executes the command on this server. + + + This method will apply logic that is specific to commands that write (e.g. + drop). + The default value for the "writeConcern" option will be + inferred from an active transaction (indicated by the + "session" option), followed by the + connection URI. + + + + This method is not intended to be used to execute + insert, + update, + or delete + commands. Users are encouraged to use + MongoDB\Driver\Server::executeBulkWrite for those + operations. + + + + + + &reftitle.parameters; + + &mongodb.parameter.db; + &mongodb.parameter.command; + + options + + + + options + + + + Option + Type + Description + + + + &mongodb.option.session; + &mongodb.option.writeConcern; + + +
+
+ &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; + + final public stringMongoDB\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; + + <function>MongoDB\Driver\Server::getHost</function> の例 + +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; + + final public arrayMongoDB\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; + + <function>MongoDB\Driver\Server::getInfo</function> の例 + +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; + + final public integernullMongoDB\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; + + <function>MongoDB\Driver\Server::getLatency</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\Server::getPort</function> の例 + +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; + + final public MongoDB\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; + + final public arrayMongoDB\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; + + final public intMongoDB\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; + + final public boolMongoDB\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; + + final public boolMongoDB\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; + + final public boolMongoDB\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; + + final public boolMongoDB\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; + + final public boolMongoDB\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; + + final public stdClassMongoDB\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; + + final public MongoDB\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; + + final public arrayMongoDB\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; + + final public stringMongoDB\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; + + final public intMongoDB\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; + + final public intMongoDB\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; + + final public intnullMongoDB\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; + + final public stringMongoDB\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; + + final public voidMongoDB\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; + + final public voidMongoDB\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; + + final public voidMongoDB\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; + + final public voidMongoDB\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; + + final private MongoDB\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; + + final public voidMongoDB\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; + + final public objectnullMongoDB\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; + + final public objectMongoDB\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; + + final public MongoDB\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..5c2f570a52 --- /dev/null +++ b/reference/mongodb/mongodb/driver/session/getserver.xml @@ -0,0 +1,71 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Session::getServer + server to which this session is pinned を返す + + + + &reftitle.description; + + final public MongoDB\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..989afac305 --- /dev/null +++ b/reference/mongodb/mongodb/driver/session/gettransactionoptions.xml @@ -0,0 +1,70 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Session::getTransactionOptions + 現在実行中のトランザクションのオプションを返す + + + + &reftitle.description; + + final public arraynullMongoDB\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..65640bd048 --- /dev/null +++ b/reference/mongodb/mongodb/driver/session/gettransactionstate.xml @@ -0,0 +1,70 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Session::getTransactionState + current transaction state for this session を返す + + + + &reftitle.description; + + final public stringMongoDB\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..c5dcaf3e97 --- /dev/null +++ b/reference/mongodb/mongodb/driver/session/isdirty.xml @@ -0,0 +1,63 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Session::isDirty + the session has been marked as dirty かどうかを返す + + + + &reftitle.description; + + final public boolMongoDB\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..6a48c6db70 --- /dev/null +++ b/reference/mongodb/mongodb/driver/session/isintransaction.xml @@ -0,0 +1,72 @@ + +<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + + + + + MongoDB\Driver\Session::isInTransaction + a multi-document transaction is in progress かどうかを返す + + + + &reftitle.description; + + final public boolMongoDB\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; + + final public voidMongoDB\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. + + + + options + + + + Option + Type + Description + + + + &mongodb.option.maxCommitTimeMS; + &mongodb.option.readConcern; + &mongodb.option.readPreference; + &mongodb.option.writeConcern; + + +
+
+
+
+
+
+ + + &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; + + final public arrayMongoDB\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; + + final public stringMongoDB\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; + + final public boolMongoDB\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; + + final public boolMongoDB\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; + + final public stdClassMongoDB\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; + + <function>MongoDB\Driver\WriteConcern::bsonSerialize</function> with majority write concern + +bsonSerialize()); + +echo "\n", MongoDB\BSON\Document::fromPHP($wc)->toRelaxedExtendedJSON(); + +?> +]]> + + &example.outputs.similar; + + + string(8) "majority" +} + +{ "w" : "majority" } +]]> + + + <function>MongoDB\Driver\WriteConcern::bsonSerialize</function> 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; + + final public MongoDB\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; + + <function>MongoDB\Driver\WriteConcern::__construct</function> の例 + + +]]> + + + + + + + &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; + + final public boolnullMongoDB\Driver\WriteConcern::getJournal + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the WriteConcern's "journal" option. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\WriteConcern::getJournal</function> の例 + +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; + + final public stringintnullMongoDB\Driver\WriteConcern::getW + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the WriteConcern's "w" option. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\WriteConcern::getW</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\WriteConcern::getWtimeout</function> の例 + +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; + + final public boolMongoDB\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; + + <function>MongoDB\Driver\WriteConcern::isDefault</function> の例 + +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; + + final public intMongoDB\Driver\WriteConcernError::getCode + + + + + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the WriteConcernError's error code. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\WriteConcernError::getCode</function> の例 + +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; + + final public objectnullMongoDB\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; + + <function>MongoDB\Driver\WriteConcernError::getInfo</function> の例 + +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; + + final public stringMongoDB\Driver\WriteConcernError::getMessage + + + + + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the WriteConcernError's error message. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\WriteConcernError::getMessage</function> の例 + +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; + + final public intMongoDB\Driver\WriteError::getCode + + + + + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the WriteError's error code. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\WriteError::getCode</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\WriteError::getIndex</function> の例 + +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; + + final public objectnullMongoDB\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; + + final public stringMongoDB\Driver\WriteError::getMessage + + + + + + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the WriteError's error message. + + + + + &reftitle.errors; + + &mongodb.throws.argumentparsing; + + + + + + &reftitle.examples; + + <function>MongoDB\Driver\WriteError::getMessage</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\WriteResult::getDeletedCount</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\WriteResult::getInsertedCount</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\WriteResult::getMatchedCount</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\WriteResult::getModifiedCount</function> の例 + +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; + + final public MongoDB\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; + + <function>MongoDB\Driver\WriteResult::getServer</function> の例 + +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; + + final public intMongoDB\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; + + <function>MongoDB\Driver\WriteResult::getUpsertedCount</function> の例 + +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; + + final public arrayMongoDB\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; + + <function>MongoDB\Driver\WriteResult::getUpsertedIds</function> の例 + +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; + + final public MongoDB\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; + + <function>MongoDB\Driver\WriteResult::getWriteConcernError</function> の例 + +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; + + final public arrayMongoDB\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; + + <function>MongoDB\Driver\WriteResult::getWriteErrors</function> 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 + } +} +]]> + + + + <function>MongoDB\Driver\WriteResult::getWriteErrors</function> 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; + + final public boolMongoDB\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; + + <function>MongoDB\Driver\WriteResult::isAcknowledged</function> with acknowledged write concern + +insert(['x' => 1]); + +$result = $manager->executeBulkWrite('db.collection', $bulk); + +var_dump($result->isAcknowledged()); + +?> +]]> + + &example.outputs; + + + + + + <function>MongoDB\Driver\WriteResult::isAcknowledged</function> 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. + +
+
+ From 22610daa907b7d97c89f562fc445c05a8e5c3599 Mon Sep 17 00:00:00 2001 From: lacatoire Date: Mon, 23 Feb 2026 14:23:37 +0100 Subject: [PATCH 2/3] =?UTF-8?q?Fix=20escaped=20exclamation=20marks=20in=20?= =?UTF-8?q?XML=20comments=20(<\!--=20=E2=86=92=20 + diff --git a/reference/mongodb/mongodb/driver/clientencryption/addkeyaltname.xml b/reference/mongodb/mongodb/driver/clientencryption/addkeyaltname.xml index cb3875430a..a43d60edd6 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/addkeyaltname.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/addkeyaltname.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/createdatakey.xml b/reference/mongodb/mongodb/driver/clientencryption/createdatakey.xml index 70fc4d5d9d..3b6a78c4fe 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/createdatakey.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/createdatakey.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/decrypt.xml b/reference/mongodb/mongodb/driver/clientencryption/decrypt.xml index 178cb87420..1b7457ef80 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/decrypt.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/decrypt.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/deletekey.xml b/reference/mongodb/mongodb/driver/clientencryption/deletekey.xml index 74a0b0f626..0a75691dae 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/deletekey.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/deletekey.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/encrypt.xml b/reference/mongodb/mongodb/driver/clientencryption/encrypt.xml index 65fc2f73da..9469d60839 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/encrypt.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/encrypt.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/encryptexpression.xml b/reference/mongodb/mongodb/driver/clientencryption/encryptexpression.xml index 6cdd4b4336..1e72e3a3a8 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/encryptexpression.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/encryptexpression.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/getkey.xml b/reference/mongodb/mongodb/driver/clientencryption/getkey.xml index 67b1359bf3..c58c32edc9 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/getkey.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/getkey.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/getkeybyaltname.xml b/reference/mongodb/mongodb/driver/clientencryption/getkeybyaltname.xml index e99f40a933..45364cf35f 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/getkeybyaltname.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/getkeybyaltname.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/getkeys.xml b/reference/mongodb/mongodb/driver/clientencryption/getkeys.xml index 360657d76d..b6b02aa89a 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/getkeys.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/getkeys.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/removekeyaltname.xml b/reference/mongodb/mongodb/driver/clientencryption/removekeyaltname.xml index 60e072a3d7..153d1bf07c 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/removekeyaltname.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/removekeyaltname.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/clientencryption/rewrapmanydatakey.xml b/reference/mongodb/mongodb/driver/clientencryption/rewrapmanydatakey.xml index b26964481d..800a595011 100644 --- a/reference/mongodb/mongodb/driver/clientencryption/rewrapmanydatakey.xml +++ b/reference/mongodb/mongodb/driver/clientencryption/rewrapmanydatakey.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursor/current.xml b/reference/mongodb/mongodb/driver/cursor/current.xml index 522d83b1e9..710fcbfa0f 100644 --- a/reference/mongodb/mongodb/driver/cursor/current.xml +++ b/reference/mongodb/mongodb/driver/cursor/current.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursor/key.xml b/reference/mongodb/mongodb/driver/cursor/key.xml index c0ecd6619e..eaa0c0e075 100644 --- a/reference/mongodb/mongodb/driver/cursor/key.xml +++ b/reference/mongodb/mongodb/driver/cursor/key.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursor/next.xml b/reference/mongodb/mongodb/driver/cursor/next.xml index 8b62bd6f58..0de74aff03 100644 --- a/reference/mongodb/mongodb/driver/cursor/next.xml +++ b/reference/mongodb/mongodb/driver/cursor/next.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursor/rewind.xml b/reference/mongodb/mongodb/driver/cursor/rewind.xml index b7183d3bab..0734567b35 100644 --- a/reference/mongodb/mongodb/driver/cursor/rewind.xml +++ b/reference/mongodb/mongodb/driver/cursor/rewind.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursor/valid.xml b/reference/mongodb/mongodb/driver/cursor/valid.xml index 7601d11991..b6dbe57cb0 100644 --- a/reference/mongodb/mongodb/driver/cursor/valid.xml +++ b/reference/mongodb/mongodb/driver/cursor/valid.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursorinterface.xml b/reference/mongodb/mongodb/driver/cursorinterface.xml index c003b9cce7..3b255e3d6d 100644 --- a/reference/mongodb/mongodb/driver/cursorinterface.xml +++ b/reference/mongodb/mongodb/driver/cursorinterface.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursorinterface/getid.xml b/reference/mongodb/mongodb/driver/cursorinterface/getid.xml index 6d0c0d49c8..1d14cfe6fa 100644 --- a/reference/mongodb/mongodb/driver/cursorinterface/getid.xml +++ b/reference/mongodb/mongodb/driver/cursorinterface/getid.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursorinterface/getserver.xml b/reference/mongodb/mongodb/driver/cursorinterface/getserver.xml index 4bc09770a2..6f1551795d 100644 --- a/reference/mongodb/mongodb/driver/cursorinterface/getserver.xml +++ b/reference/mongodb/mongodb/driver/cursorinterface/getserver.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursorinterface/isdead.xml b/reference/mongodb/mongodb/driver/cursorinterface/isdead.xml index 804dca0256..595b0cdbc0 100644 --- a/reference/mongodb/mongodb/driver/cursorinterface/isdead.xml +++ b/reference/mongodb/mongodb/driver/cursorinterface/isdead.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml b/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml index fcab9bba79..403285280d 100644 --- a/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml +++ b/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/cursorinterface/toarray.xml b/reference/mongodb/mongodb/driver/cursorinterface/toarray.xml index c9acbbeaa7..428e00569a 100644 --- a/reference/mongodb/mongodb/driver/cursorinterface/toarray.xml +++ b/reference/mongodb/mongodb/driver/cursorinterface/toarray.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/exception/encryptionexception.xml b/reference/mongodb/mongodb/driver/exception/encryptionexception.xml index 7cd729335d..88752e333c 100644 --- a/reference/mongodb/mongodb/driver/exception/encryptionexception.xml +++ b/reference/mongodb/mongodb/driver/exception/encryptionexception.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/manager/createclientencryption.xml b/reference/mongodb/mongodb/driver/manager/createclientencryption.xml index 24163009b3..96f05aa741 100644 --- a/reference/mongodb/mongodb/driver/manager/createclientencryption.xml +++ b/reference/mongodb/mongodb/driver/manager/createclientencryption.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/readpreference/gethedge.xml b/reference/mongodb/mongodb/driver/readpreference/gethedge.xml index 016d2a55f4..56a65abb47 100644 --- a/reference/mongodb/mongodb/driver/readpreference/gethedge.xml +++ b/reference/mongodb/mongodb/driver/readpreference/gethedge.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/readpreference/getmodestring.xml b/reference/mongodb/mongodb/driver/readpreference/getmodestring.xml index bd39e89660..5a2ae669ce 100644 --- a/reference/mongodb/mongodb/driver/readpreference/getmodestring.xml +++ b/reference/mongodb/mongodb/driver/readpreference/getmodestring.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/session/getserver.xml b/reference/mongodb/mongodb/driver/session/getserver.xml index 5c2f570a52..f96a74b8a3 100644 --- a/reference/mongodb/mongodb/driver/session/getserver.xml +++ b/reference/mongodb/mongodb/driver/session/getserver.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/session/gettransactionoptions.xml b/reference/mongodb/mongodb/driver/session/gettransactionoptions.xml index 989afac305..b43202fb6b 100644 --- a/reference/mongodb/mongodb/driver/session/gettransactionoptions.xml +++ b/reference/mongodb/mongodb/driver/session/gettransactionoptions.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/session/gettransactionstate.xml b/reference/mongodb/mongodb/driver/session/gettransactionstate.xml index 65640bd048..797e669790 100644 --- a/reference/mongodb/mongodb/driver/session/gettransactionstate.xml +++ b/reference/mongodb/mongodb/driver/session/gettransactionstate.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/session/isdirty.xml b/reference/mongodb/mongodb/driver/session/isdirty.xml index c5dcaf3e97..e7e4785cbc 100644 --- a/reference/mongodb/mongodb/driver/session/isdirty.xml +++ b/reference/mongodb/mongodb/driver/session/isdirty.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + diff --git a/reference/mongodb/mongodb/driver/session/isintransaction.xml b/reference/mongodb/mongodb/driver/session/isintransaction.xml index 6a48c6db70..e239a1fc18 100644 --- a/reference/mongodb/mongodb/driver/session/isintransaction.xml +++ b/reference/mongodb/mongodb/driver/session/isintransaction.xml @@ -1,5 +1,5 @@ -<\!-- EN-Revision: dac7a370d34ddda0a647ea551c28d6e168261613 Maintainer: mumumu Status: ready --> + From d9b2a21e1e1f764a2ecc740751844c897deeeb0b Mon Sep 17 00:00:00 2001 From: lacatoire Date: Mon, 23 Feb 2026 14:29:51 +0100 Subject: [PATCH 3/3] =?UTF-8?q?Fix=20textlint:=20=E3=83=87=E3=82=B7?= =?UTF-8?q?=E3=83=AA=E3=82=A2=E3=83=A9=E3=82=A4=E3=82=BA=20=E2=86=92=20?= =?UTF-8?q?=E3=82=A2=E3=83=B3=E3=82=B7=E3=83=AA=E3=82=A2=E3=83=A9=E3=82=A4?= =?UTF-8?q?=E3=82=BA=20(4=20occurrences)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reference/mongodb/architecture.xml | 4 ++-- reference/mongodb/mongodb/driver/cursor/settypemap.xml | 2 +- .../mongodb/mongodb/driver/cursorinterface/settypemap.xml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/reference/mongodb/architecture.xml b/reference/mongodb/architecture.xml index 1c73278eea..62f9760866 100644 --- a/reference/mongodb/architecture.xml +++ b/reference/mongodb/architecture.xml @@ -189,7 +189,7 @@ foreach ($managers as $manager) {
データの永続化 - PHP 変数の MongoDB へのシリアライズとデシリアライズ + PHP 変数の MongoDB へのシリアライズとアンシリアライズ このドキュメントでは、複合構造 (ドキュメント、配列、オブジェクト) が BSON と PHP の値の間でどのように変換されるかについて説明します。 @@ -510,7 +510,7 @@ class UpperClass implements MongoDB\BSON\Persistable
- BSON からのデシリアライズ + BSON からのアンシリアライズ &mongodb.warning.duplicate-keys; diff --git a/reference/mongodb/mongodb/driver/cursor/settypemap.xml b/reference/mongodb/mongodb/driver/cursor/settypemap.xml index 9c167f4c40..c367cfe244 100644 --- a/reference/mongodb/mongodb/driver/cursor/settypemap.xml +++ b/reference/mongodb/mongodb/driver/cursor/settypemap.xml @@ -5,7 +5,7 @@ MongoDB\Driver\Cursor::setTypeMap - BSON のデシリアライズに使用する型マップを設定する + BSON のアンシリアライズに使用する型マップを設定する diff --git a/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml b/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml index 403285280d..c9a3eb708c 100644 --- a/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml +++ b/reference/mongodb/mongodb/driver/cursorinterface/settypemap.xml @@ -5,7 +5,7 @@ MongoDB\Driver\CursorInterface::setTypeMap - BSON のデシリアライズに使用する型マップを設定する + BSON のアンシリアライズに使用する型マップを設定する