* An array of options for the MongoDB driver. Options include setting * connection {@link https://php.net/manual/en/mongo.connecting.ssl.php#mongo.connecting.context.ssl context options for SSL} * or {@link https://php.net/manual/en/context.mongodb.php logging callbacks}. *
* "context" *
** The Stream Context to attach to all new connections. This allows you * for example to configure SSL certificates and are described at * {@link https://php.net/manual/en/context.ssl.php SSL context options}. See the * {@link https://php.net/manual/en/mongo.connecting.ssl.php#mongo.connecting.context.ssl Connecting over SSL} tutorial. *
** If connection is not given, or FALSE then connection that would be selected for writes would be closed. In a single-node configuration, that is then the whole connection, but if you are connected to a replica set, close() will only close the connection to the primary server. * If connection is TRUE then all connections as known by the connection manager will be closed. This can include connections that are not referenced in the connection string used to create the object that you are calling close on. * If connection is a string argument, then it will only close the connection identified by this hash. Hashes are identifiers for a connection and can be obtained by calling {@see MongoClient::getConnections()}. *
* @return bool If the connection was successfully closed. */ public function close($connection) {} /** * Connects to a database server * * @link https://secure.php.net/manual/en/mongoclient.connect.php * * @throws MongoConnectionException * @return bool If the connection was successful. */ public function connect() {} /** * Drops a database * * @link https://secure.php.net/manual/en/mongoclient.dropdb.php * @param mixed $db The database to drop. Can be a MongoDB object or the name of the database. * @return array The database response. */ #[Deprecated(replacement: "%class%->drop()")] public function dropDB($db) {} /** * (PECL mongo >= 1.3.0)This function returns an array describing the write concern. * The array contains the values w for an integer acknowledgement level or string mode, * and wtimeout denoting the maximum number of milliseconds to wait for the server to satisfy the write concern.
*/ public function getWriteConcern() {} /** * Kills a specific cursor on the server * @link https://secure.php.net/manual/en/mongoclient.killcursor.php * @param string $server_hash* The server hash that has the cursor. This can be obtained through * {@link https://secure.php.net/manual/en/mongocursor.info.php MongoCursor::info()}. *
* @param int|MongoInt64 $id ** The ID of the cursor to kill. You can either supply an {@link https://secure.php.net/manual/en/language.types.integer.php int} * containing the 64 bit cursor ID, or an object of the * {@link https://secure.php.net/manual/en/class.mongoint64.php MongoInt64} class. The latter is necessary on 32 * bit platforms (and Windows). *
*/ public function killCursor($server_hash, $id) {} /** * (PECL mongo >= 1.3.0)The address of the secondary this connection is using for reads. *
** This returns NULL if this is not connected to a replica set or not yet * initialized. *
*/ public function getSlave() {} /** * (PECL mongo >= 1.1.0)in use
*The number of connections currently being used by MongoClient instances. * in pool * The number of connections currently in the pool (not being used).
*remaining
* *The number of connections that could be created by this pool. For example, suppose a pool had 5 connections remaining and 3 connections in the pool. We could create 8 new instances of MongoClient before we exhausted this pool (assuming no instances of MongoClient went out of scope, returning their connections to the pool). * * A negative number means that this pool will spawn unlimited connections. * * Before a pool is created, you can change the max number of connections by calling Mongo::setPoolSize(). Once a pool is showing up in the output of this function, its size cannot be changed.
*timeout
* *The socket timeout for connections in this pool. This is how long connections in this pool will attempt to connect to a server before giving up.
* @see MongoPool::info() */ #[Deprecated('@deprecated This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::info() instead.')] public function poolDebug() {} /** * (PECL mongo >= 1.1.0)* If reads should be sent to secondary members of a replica set for all * possible queries using this {@see MongoClient} instance. *
* @return bool returns the former value of slaveOkay for this instance. */ public function setSlaveOkay($ok) {} /** *(PECL mongo >= 1.2.0)The max number of connections future pools will be able to create. Negative numbers mean that the pool will spawn an infinite number of connections.
* @return bool Returns the former value of pool size. * @see MongoPool::setSize() */ #[Deprecated('Relying on this feature is highly discouraged. Please use MongoPool::setSize() instead.')] public function setPoolSize($size) {} /** * Creates a persistent connection with a database server * @link https://secure.php.net/manual/en/mongo.persistconnect.php * @param string $username A username used to identify the connection. * @param string $password A password used to identify the connection. * @throws MongoConnectionException * @return bool If the connection was successful. */ #[Deprecated('Pass array("persist" => $id) to the constructor instead of using this method.')] public function persistConnect($username = "", $password = "") {} /** * Creates a persistent connection with paired database servers * @link https://secure.php.net/manual/en/mongo.pairpersistconnect.php * @param string $username A username used to identify the connection. * @param string $password A password used to identify the connection. * @throws MongoConnectionException * @return bool If the connection was successful. */ #[Deprecated('Pass "mongodb://server1,server2" and array("persist" => $id) to the constructor instead of using this method.')] public function pairPersistConnect($username = "", $password = "") {} /** * Connects with a database server * * @link https://secure.php.net/manual/en/mongo.connectutil.php * @throws MongoConnectionException * @return bool If the connection was successful. */ protected function connectUtil() {} /** * Check if there was an error on the most recent db operation performed * @link https://secure.php.net/manual/en/mongo.lasterror.php * @return array|null Returns the error, if there was one, or NULL. * @see MongoDB::lastError() */ #[Deprecated('Use MongoDB::lastError() instead.')] public function lastError() {} /** * Checks for the last error thrown during a database operation * @link https://secure.php.net/manual/en/mongo.preverror.php * @return array Returns the error and the number of operations ago it occurred. * @see MongoDB::prevError() */ #[Deprecated('Use MongoDB::prevError() instead.')] public function prevError() {} /** * Clears any flagged errors on the connection * @link https://secure.php.net/manual/en/mongo.reseterror.php * @return array Returns the database response. * @see MongoDB::resetError() */ #[Deprecated('Use MongoDB::resetError() instead.')] public function resetError() {} /** * Creates a database error on the database. * @link https://secure.php.net/manual/en/mongo.forceerror.php * @return bool The database response. * @see MongoDB::forceError() */ #[Deprecated('Use MongoDB::forceError() instead.')] public function forceError() {} } /** * Instances of this class are used to interact with a database. * @link https://secure.php.net/manual/en/class.mongodb.php */ class MongoDB { /** * Profiling is off. * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-off */ public const PROFILING_OFF = 0; /** * Profiling is on for slow operations (>100 ms). * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-slow */ public const PROFILING_SLOW = 1; /** * Profiling is on for all operations. * @link https://php.net/manual/en/class.mongodb.php#mongodb.constants.profiling-on */ public const PROFILING_ON = 2; /** * @var int ** The number of servers to replicate a change to before returning success. * Inherited by instances of {@link https://php.net/manual/en/class.mongocollection.php MongoCollection} derived * from this. w functionality is only available in * version 1.5.1+ of the MongoDB server and 1.0.8+ of the driver. *
** w is used whenever you need to adjust the * acknowledgement level * ( {@link https://php.net/manual/en/mongocollection.insert.php MongoCollection::insert()}, * {@link https://php.net/manual/en/mongocollection.update.php MongoCollection::update()}, * {@link https://php.net/manual/en/mongocollection.remove.php MongoCollection::remove()}, * {@link https://php.net/manual/en/mongocollection.save.php MongoCollection::save()}, and * {@link https://php.net/manual/en/mongocollection.ensureindex.php MongoCollection::ensureIndex()} all support this * option). With the default value (1), an acknowledged operation will return once * the database server has the operation. If the server goes down before * the operation has been replicated to a secondary, it is possible to lose * the operation forever. Thus, you can specify w to be * higher than one and guarantee that at least one secondary has the * operation before it is considered successful. *
** For example, if w is 2, the primary and one secondary * must have a record of the operation or the driver will throw a * {@link https://php.net/manual/en/class.mongocursorexception.php MongoCursorException}. It is tempting to set * w to the total number of secondaries + primary, but * then if one secondary is down the operation will fail and an exception * will be thrown, so usually w=2 is safest (primary and * one secondary). *
*/ public $w = 1; /** * @var int* T he number of milliseconds to wait for MongoDB::$w * replications to take place. Inherited by instances of * {@link https://secure.php.net/manual/en/class.mongocollection.php MongoCollection} derived from this. * w functionality is only available in version 1.5.1+ of * the MongoDB server and 1.0.8+ of the driver. *
** Unless wtimeout is set, the server waits forever for * replicating to w servers to finish. The driver * defaults to waiting for 10 seconds, you can change this value to alter * its behavior. *
*/ public $wtimeout = 10000; /** * (PECL mongo >= 0.9.0)If cloned files should be kept if the repair fails.
* @param bool $backup_original_files [optional]If original files should be backed up.
* @return arrayReturns db response.
*/ public function repair($preserve_cloned_files = false, $backup_original_files = false) {} /** * (PECL mongo >= 0.9.0)* Returns a new collection object. *
*/ public function selectCollection($name) {} /** * (PECL mongo >= 1.1.0)* If reads should be sent to secondary members of a replica set for all * possible queries using this {@link https://secure.php.net/manual/en/class.mongodb.php MongoDB} instance. *
* @return bool Returns the former value of slaveOkay for this instance. */ public function setSlaveOkay($ok = true) {} /** * Creates a collection * @link https://secure.php.net/manual/en/mongodb.createcollection.php * @param string $name The name of the collection. * @param array $options [optional]*
* An array containing options for the collections. Each option is its own * element in the options array, with the option name listed below being * the key of the element. The supported options depend on the MongoDB * server version. At the moment, the following options are supported: *
** capped *
* If the collection should be a fixed size. *
* ** size *
* If the collection is fixed size, its size in bytes.
*max *
If the collection is fixed size, the maximum number of elements to store in the collection.
* autoIndexId * ** If capped is TRUE you can specify FALSE to disable the * automatic index created on the _id field. * Before MongoDB 2.2, the default value for * autoIndexId was FALSE. *
* * @return MongoCollectionReturns a collection object representing the new collection.
*/ public function createCollection($name, $options) {} /** * (PECL mongo >= 0.9.0)Include system collections.
* @return array Returns a list of MongoCollections. */ public function listCollections($includeSystemCollections = false) {} /** * (PECL mongo >= 0.9.0)* If an array or object is given, its _id field will be * used as the reference ID. If a {@see MongoId} or scalar * is given, it will be used as the reference ID. *
* @return arrayReturns a database reference array.
** If an array without an _id field was provided as the * document_or_id parameter, NULL will be returned. *
*/ public function createDBRef($collection, $document_or_id) {} /** * (PECL mongo >= 0.9.0)This function returns an array describing the write concern. * The array contains the values w for an integer acknowledgement level or string mode, * and wtimeout denoting the maximum number of milliseconds to wait for the server to satisfy the write concern.
*/ public function getWriteConcern() {} /** * (PECL mongo >= 0.9.3)* This parameter is an associative array of the form * array("optionname" => <boolean>, ...). Currently * supported options are: *
"timeout"
Deprecated alias for "socketTimeoutMS".
Returns database response. If the login was successful, it will return 1.
*
* <?php
* array(
* "ok"
* =>
* 1
* );
* ?>
*
If something went wrong, it will return
*
* <?php
* array(
* "ok"
* =>
* 0
* ,
* "errmsg"
* =>
* "auth fails"
* );
* ?>
*
("auth fails" could be another message, depending on database version and * what went wrong)
*/ public function authenticate($username, $password) {} /** * (PECL mongo >= 1.3.0)The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.
* @param array $tags [optional]An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members.
* @return bool Returns TRUE on success, or FALSE otherwise. */ public function setReadPreference($read_preference, array $tags) {} /** * (PECL mongo >= 1.5.0)The write concern. This may be an integer denoting the number of servers required to acknowledge the write, or a string mode (e.g. "majority").
* @param int $wtimeout [optional]The maximum number of milliseconds to wait for the server to satisfy the write concern.
* @return bool Returns TRUE on success, or FALSE otherwise. */ public function setWriteConcern($w, $wtimeout) {} } /** * Represents a database collection. * @link https://secure.php.net/manual/en/class.mongocollection.php */ class MongoCollection { /** * @link https://php.net/manual/en/class.mongocollection.php#mongocollection.constants.ascending */ public const ASCENDING = 1; /** * @link https://php.net/manual/en/class.mongocollection.php#mongocollection.constants.descending */ public const DESCENDING = -1; /** * @var MongoDB */ public $db = null; /** * @var int* The number of servers to replicate a change to before returning success. * Value is inherited from the parent database. The * {@link https://secure.php.net/manual/en/class.mongodb.php MongoDB} class has a more detailed description of * how w works. *
*/ public $w; /** * @var int* The number of milliseconds to wait for $this->w * replications to take place. Value is inherited from the parent database. * The {@link https://secure.php.net/manual/en/class.mongodb.php MongoDB} class has a more detailed description * of how wtimeout works. *
*/ public $wtimeout; /** * Creates a new collection * @link https://secure.php.net/manual/en/mongocollection.construct.php * @param MongoDB $db Parent database. * @param string $name Name for this collection. * @throws Exception */ public function __construct(MongoDB $db, $name) {} /** * String representation of this collection * @link https://secure.php.net/manual/en/mongocollection.--tostring.php * @return string Returns the full name of this collection. */ public function __toString() {} /** * Gets a collection * @link https://secure.php.net/manual/en/mongocollection.get.php * @param string $name The next string in the collection name. * @return MongoCollection */ public function __get($name) {} /** * (PECL mongo >= 1.3.0)* The MongoDB * {@link https://docs.mongodb.org/manual/applications/aggregation/ aggregation framework} * provides a means to calculate aggregated values without having to use * MapReduce. While MapReduce is powerful, it is often more difficult than * necessary for many simple aggregation tasks, such as totaling or averaging * field values. *
** This method accepts either a variable amount of pipeline operators, or a * single array of operators constituting the pipeline. *
* @link https://secure.php.net/manual/en/mongocollection.aggregate.php * @param array $pipelineAn array of pipeline operators, or just the first operator.
* @param array $op [optional]The second pipeline operator.
* @param array $pipelineOperators [optional]Additional pipeline operators.
* @return array The result of the aggregation as an array. The ok will be set to 1 on success, 0 on failure. */ public function aggregate(array $pipeline, array $op, array $pipelineOperators) {} /** * (PECL mongo >= 1.5.0)* With this method you can execute Aggregation Framework pipelines and retrieve the results * through a cursor, instead of getting just one document back as you would with * {@link https://php.net/manual/en/mongocollection.aggregate.php MongoCollection::aggregate()}. * This method returns a {@link https://php.net/manual/en/class.mongocommandcursor.php MongoCommandCursor} object. * This cursor object implements the {@link https://php.net/manual/en/class.iterator.php Iterator} interface * just like the {@link https://php.net/manual/en/class.mongocursor.php MongoCursor} objects that are returned * by the {@link https://php.net/manual/en/mongocollection.find.php MongoCollection::find()} method *
* * @link https://php.net/manual/en/mongocollection.aggregatecursor.php * * @param array $pipelineThe Aggregation Framework pipeline to execute.
* @param array $options [optional]Options for the aggregation command
* * @return MongoCommandCursor Returns a {@link https://php.net/manual/en/class.mongocommandcursor.php MongoCommandCursor} object */ public function aggregateCursor(array $pipeline, array $options) {} /** * Returns this collection's name * @link https://secure.php.net/manual/en/mongocollection.getname.php * @return string */ public function getName() {} /** * (PECL mongo >= 1.1.0)* See {@link https://secure.php.net/manual/en/mongo.queries.php the query section} of this manual for * information on distributing reads to secondaries. *
* @link https://secure.php.net/manual/en/mongocollection.getslaveokay.php * @return bool Returns the value of slaveOkay for this instance. */ public function getSlaveOkay() {} /** * (PECL mongo >= 1.1.0)* See {@link https://secure.php.net/manual/en/mongo.queries.php the query section} of this manual for * information on distributing reads to secondaries. *
* @link https://secure.php.net/manual/en/mongocollection.setslaveokay.php * @param bool $ok [optional]* If reads should be sent to secondary members of a replica set for all * possible queries using this {@link https://secure.php.net/manual/en/class.mongocollection.php MongoCollection} * instance. * @return bool Returns the former value of slaveOkay for this instance. *
*/ public function setSlaveOkay($ok = true) {} /** * (PECL mongo >= 1.3.0)The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.
* @param array $tags [optional]An array of zero or more tag sets, where each tag set is itself an array of criteria used to match tags on replica set members.
* @return bool Returns TRUE on success, or FALSE otherwise. */ public function setReadPreference($read_preference, array $tags) {} /** * Drops this collection * @link https://secure.php.net/manual/en/mongocollection.drop.php * @return array Returns the database response. */ public function drop() {} /** * Validates this collection * @link https://secure.php.net/manual/en/mongocollection.validate.php * @param bool $scan_data Only validate indices, not the base collection. * @return array Returns the database's evaluation of this object. */ public function validate($scan_data = false) {} /** * Inserts an array into the collection * @link https://secure.php.net/manual/en/mongocollection.insert.php * @param array|object $a An array or object. If an object is used, it may not have protected or private properties. * Note: If the parameter does not have an _id key or property, a new MongoId instance will be created and assigned to it. * This special behavior does not mean that the parameter is passed by reference. * @param array $options Options for the insert. *
Query criteria for the documents to delete.
* @param array $options [optional]An array of options for the remove operation. Currently available options * include: *
"w"
See {@link https://secure.php.net/manual/en/mongo.writeconcerns.php Write Concerns}. The default value for MongoClient is 1.
* "justOne" *
*
* Specify TRUE
to limit deletion to just one document. If FALSE
or
* omitted, all documents matching the criteria will be deleted.
*
"fsync"
Boolean, defaults to FALSE. If journaling is enabled, it works exactly like "j". If journaling is not enabled, the write operation blocks until it is synced to database files on disk. If TRUE
, an acknowledged insert is implied and this option will override setting "w" to 0.
Note: If journaling is enabled, users are strongly encouraged to use the "j" option instead of "fsync". Do not use "fsync" and "j" simultaneously, as that will result in an error.
"j"
Boolean, defaults to FALSE. Forces the write operation to block until it is synced to the journal on disk. If TRUE
, an acknowledged write is implied and this option will override setting "w" to 0.
Note: If this option is used and journaling is disabled, MongoDB 2.6+ will raise an error and the write will fail; older server versions will simply ignore the option.
"socketTimeoutMS"
This option specifies the time limit, in milliseconds, for socket communication. If the server does not respond within the timeout period, a MongoCursorTimeoutException will be thrown and there will be no way to determine if the server actually handled the write or not. A value of -1 may be specified to block indefinitely. The default value for MongoClient is 30000 (30 seconds).
"w"
See {@link https://secure.php.net/manual/en/mongo.writeconcerns.php Write Concerns}. The default value for MongoClient is 1.
"wTimeoutMS"
This option specifies the time limit, in milliseconds, for {@link https://secure.php.net/manual/en/mongo.writeconcerns.php write concern} acknowledgement. It is only applicable when "w" is greater than 1, as the timeout pertains to replication. If the write concern is not satisfied within the time limit, a MongoCursorException will be thrown. A value of 0 may be specified to block indefinitely. The default value for {@link https://secure.php.net/manual/en/class.mongoclient.php MongoClient} is 10000 (ten seconds).
* The following options are deprecated and should no longer be used: *
"safe"
Deprecated. Please use the {@link https://secure.php.net/manual/en/mongo.writeconcerns.php write concern} "w" option.
"timeout"
Deprecated alias for "socketTimeoutMS".
"wtimeout"
Deprecated alias for "wTimeoutMS".
Returns an array containing the status of the removal if the * "w" option is set. Otherwise, returns TRUE. *
** Fields in the status array are described in the documentation for * MongoCollection::insert(). *
*/ public function remove(array $criteria = [], array $options = []) {} /** * Querys this collection * @link https://secure.php.net/manual/en/mongocollection.find.php * @param array $query The fields for which to search. * @param array $fields Fields of the results to return. * @return MongoCursor */ public function find(array $query = [], array $fields = []) {} /** * Retrieve a list of distinct values for the given key across a collection * @link https://secure.php.net/manual/en/mongocollection.distinct.php * @param string $key The key to use. * @param array $query An optional query parameters * @return array|false Returns an array of distinct values, or FALSE on failure */ public function distinct($key, array $query = null) {} /** * Update a document and return it * @link https://secure.php.net/manual/en/mongocollection.findandmodify.php * @param array $query The query criteria to search for. * @param array $update The update criteria. * @param array $fields Optionally only return these fields. * @param array $options An array of options to apply, such as remove the match document from the DB and return it. * @return array Returns the original document, or the modified document when new is set. */ public function findAndModify(array $query, array $update = null, array $fields = null, array $options = null) {} /** * Querys this collection, returning a single element * @link https://secure.php.net/manual/en/mongocollection.findone.php * @param array $query The fields for which to search. * @param array $fields Fields of the results to return. * @param array $options This parameter is an associative array of the form array("name" => `* Set timeout in milliseconds for all database responses. Use * -1 to wait forever. Can be overridden with * {link https://secure.php.net/manual/en/mongocursor.timeout.php MongoCursor::timeout()}. This does not cause the * MongoDB server to cancel the operation; it only instructs the driver to * stop waiting for a response and throw a * {@link https://php.net/manual/en/class.mongocursortimeoutexception.php MongoCursorTimeoutException} after a set time. *
*/ public static $timeout = 30000; /** * Create a new cursor * @link https://secure.php.net/manual/en/mongocursor.construct.php * @param MongoClient $connection Database connection. * @param string $ns Full name of database and collection. * @param array $query Database query. * @param array $fields Fields to return. */ public function __construct($connection, $ns, array $query = [], array $fields = []) {} /** * (PECL mongo >= 1.2.11)If the cursor should wait for more data to become available.
* @return MongoCursor Returns this cursor. */ public function awaitData($wait = true) {} /** * Checks if there are any more elements in this cursor * @link https://secure.php.net/manual/en/mongocursor.hasnext.php * @throws MongoConnectionException * @throws MongoCursorTimeoutException * @return bool Returns true if there is another element */ public function hasNext() {} /** * Return the next object to which this cursor points, and advance the cursor * @link https://secure.php.net/manual/en/mongocursor.getnext.php * @throws MongoConnectionException * @throws MongoCursorTimeoutException * @return array Returns the next object */ public function getNext() {} /** * (PECL mongo >= 1.3.3)If receiving partial results is okay.
* @return MongoCursor Returns this cursor. */ public function partial($okay = true) {} /** * (PECL mongo >= 1.2.1)* Which flag to set. You can not set flag 6 (EXHAUST) as the driver does * not know how to handle them. You will get a warning if you try to use * this flag. For available flags, please refer to the wire protocol * {@link https://www.mongodb.org/display/DOCS/Mongo+Wire+Protocol#MongoWireProtocol-OPQUERY documentation}. *
* @param bool $set [optional]Whether the flag should be set (TRUE) or unset (FALSE).
* @return MongoCursor */ public function setFlag($flag, $set = true) {} /** * (PECL mongo >= 1.3.3)The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.
* @param array $tags [optional]The read preference mode: MongoClient::RP_PRIMARY, MongoClient::RP_PRIMARY_PREFERRED, MongoClient::RP_SECONDARY, MongoClient::RP_SECONDARY_PREFERRED, or MongoClient::RP_NEAREST.
* @return MongoCursor Returns this cursor. */ public function setReadPreference($read_preference, array $tags) {} /** * Skips a number of results * @link https://secure.php.net/manual/en/mongocursor.skip.php * @param int $num The number of results to skip. * @throws MongoCursorException * @return MongoCursor Returns this cursor */ public function skip($num) {} /** * Sets whether this query can be done on a slave * This method will override the static class variable slaveOkay. * @link https://secure.php.net/manual/en/mongocursor.slaveOkay.php * @param bool $okay If it is okay to query the slave. * @throws MongoCursorException * @return MongoCursor Returns this cursor */ public function slaveOkay($okay = true) {} /** * Sets whether this cursor will be left open after fetching the last results * @link https://secure.php.net/manual/en/mongocursor.tailable.php * @param bool $tail If the cursor should be tailable. * @return MongoCursor Returns this cursor */ public function tailable($tail = true) {} /** * Sets whether this cursor will timeout * @link https://secure.php.net/manual/en/mongocursor.immortal.php * @param bool $liveForever If the cursor should be immortal. * @throws MongoCursorException * @return MongoCursor Returns this cursor */ public function immortal($liveForever = true) {} /** * Sets a client-side timeout for this query * @link https://secure.php.net/manual/en/mongocursor.timeout.php * @param int $ms The number of milliseconds for the cursor to wait for a response. By default, the cursor will wait forever. * @throws MongoCursorTimeoutException * @return MongoCursor Returns this cursor */ public function timeout($ms) {} /** * Checks if there are documents that have not been sent yet from the database for this cursor * @link https://secure.php.net/manual/en/mongocursor.dead.php * @return bool Returns if there are more results that have not been sent to the client, yet. */ public function dead() {} /** * Use snapshot mode for the query * @link https://secure.php.net/manual/en/mongocursor.snapshot.php * @throws MongoCursorException * @return MongoCursor Returns this cursor */ public function snapshot() {} /** * Sorts the results by given fields * @link https://secure.php.net/manual/en/mongocursor.sort.php * @param array $fields An array of fields by which to sort. Each element in the array has as key the field name, and as value either 1 for ascending sort, or -1 for descending sort * @throws MongoCursorException * @return MongoCursor Returns the same cursor that this method was called on */ public function sort(array $fields) {} /** * Gives the database a hint about the query * @link https://secure.php.net/manual/en/mongocursor.hint.php * @param mixed $key_pattern Indexes to use for the query. * @throws MongoCursorException * @return MongoCursor Returns this cursor */ public function hint($key_pattern) {} /** * Adds a top-level key/value pair to a query * @link https://secure.php.net/manual/en/mongocursor.addoption.php * @param string $key Fieldname to add. * @param mixed $value Value to add. * @throws MongoCursorException * @return MongoCursor Returns this cursor */ public function addOption($key, $value) {} /** * Execute the query * @link https://secure.php.net/manual/en/mongocursor.doquery.php * @throws MongoConnectionException if it cannot reach the database. * @return void */ protected function doQuery() {} /** * Returns the current element * @link https://secure.php.net/manual/en/mongocursor.current.php * @return array */ public function current() {} /** * Returns the current result's _id * @link https://secure.php.net/manual/en/mongocursor.key.php * @return string The current result's _id as a string. */ public function key() {} /** * Advances the cursor to the next result * @link https://secure.php.net/manual/en/mongocursor.next.php * @throws MongoConnectionException * @throws MongoCursorTimeoutException * @return void */ public function next() {} /** * Returns the cursor to the beginning of the result set * @throws MongoConnectionException * @throws MongoCursorTimeoutException * @return void */ public function rewind() {} /** * Checks if the cursor is reading a valid result. * @link https://secure.php.net/manual/en/mongocursor.valid.php * @return bool If the current result is not null. */ public function valid() {} /** * Clears the cursor * @link https://secure.php.net/manual/en/mongocursor.reset.php * @return void */ public function reset() {} /** * Return an explanation of the query, often useful for optimization and debugging * @link https://secure.php.net/manual/en/mongocursor.explain.php * @return array Returns an explanation of the query. */ public function explain() {} /** * Counts the number of results for this query * @link https://secure.php.net/manual/en/mongocursor.count.php * @param bool $all Send cursor limit and skip information to the count function, if applicable. * @return int The number of documents returned by this cursor's query. */ public function count($all = false) {} /** * Sets the fields for a query * @link https://secure.php.net/manual/en/mongocursor.fields.php * @param array $f Fields to return (or not return). * @throws MongoCursorException * @return MongoCursor */ public function fields(array $f) {} /** * Gets the query, fields, limit, and skip for this cursor * @link https://secure.php.net/manual/en/mongocursor.info.php * @return array The query, fields, limit, and skip for this cursor as an associative array. */ public function info() {} /** * PECL mongo >= 1.0.11 * Limits the number of elements returned in one batch. *A cursor typically fetches a batch of result objects and store them locally. * This method sets the batchSize value to configure the amount of documents retrieved from the server in one data packet. * However, it will never return more documents than fit in the max batch size limit (usually 4MB). *
* * @param int $batchSize The number of results to return per batch. Each batch requires a round-trip to the server. *If batchSize is 2 or more, it represents the size of each batch of objects retrieved. * It can be adjusted to optimize performance and limit data transfer. *
* *If batchSize is 1 or negative, it will limit of number returned documents to the absolute value of batchSize, * and the cursor will be closed. For example if batchSize is -10, then the server will return a maximum of 10 * documents and as many as can fit in 4MB, then close the cursor. *
* Warning *A batchSize of 1 is special, and means the same as -1, i.e. a value of 1 makes the cursor only capable of returning one document. *
*Note that this feature is different from MongoCursor::limit() in that documents must fit within a maximum size, * and it removes the need to send a request to close the cursor server-side. * The batch size can be changed even after a cursor is iterated, in which case the setting will apply on the next batch retrieval. *
*This cannot override MongoDB's limit on the amount of data it will return to the client (i.e., * if you set batch size to 1,000,000,000, MongoDB will still only return 4-16MB of results per batch). *
*To ensure consistent behavior, the rules of MongoCursor::batchSize() and MongoCursor::limit() behave a little complex * but work "as expected". The rules are: hard limits override soft limits with preference given to MongoCursor::limit() over * MongoCursor::batchSize(). After that, whichever is set and lower than the other will take precedence. * See below. section for some examples. *
* * @return MongoCursor Returns this cursor. * @link https://secure.php.net/manual/en/mongocursor.batchsize.php */ public function batchSize($batchSize) {} /** * (PECL mongo >= 1.5.0) * Sets a server-side timeout for this query * @link https://php.net/manual/en/mongocursor.maxtimems.php * @param int $ms* Specifies a cumulative time limit in milliseconds to be allowed by the * server for processing operations on the cursor. *
* @return MongoCursor This cursor. */ public function maxTimeMS($ms) {} } class MongoCommandCursor implements MongoCursorInterface { /** * Return the current element * @link https://php.net/manual/en/iterator.current.php * @return mixed Can return any type. * @since 5.0.0 */ public function current() {} /** * Move forward to next element * @link https://php.net/manual/en/iterator.next.php * @return void Any returned value is ignored. * @since 5.0.0 */ public function next() {} /** * Return the key of the current element * @link https://php.net/manual/en/iterator.key.php * @return mixed scalar on success, or null on failure. * @since 5.0.0 */ public function key() {} /** * Checks if current position is valid * @link https://php.net/manual/en/iterator.valid.php * @return bool The return value will be casted to boolean and then evaluated. * Returns true on success or false on failure. * @since 5.0.0 */ public function valid() {} /** * Rewind the Iterator to the first element * @link https://php.net/manual/en/iterator.rewind.php * @return void Any returned value is ignored. * @since 5.0.0 */ public function rewind() {} public function batchSize(int $batchSize): MongoCursorInterface {} public function dead(): bool {} public function info(): array {} public function getReadPreference(): array {} public function setReadPreference(string $read_preference, array $tags = null): MongoCursorInterface {} public function timeout(int $ms): MongoCursorInterface {} } interface MongoCursorInterface extends Iterator { public function batchSize(int $batchSize): MongoCursorInterface; public function dead(): bool; public function info(): array; public function getReadPreference(): array; public function setReadPreference(string $read_preference, array $tags = null): MongoCursorInterface; public function timeout(int $ms): MongoCursorInterface; } class MongoGridFS extends MongoCollection { public const ASCENDING = 1; public const DESCENDING = -1; /** * @link https://php.net/manual/en/class.mongogridfs.php#mongogridfs.props.chunks * @var MongoCollection */ public $chunks; /** * @link https://php.net/manual/en/class.mongogridfs.php#mongogridfs.props.filesname * @var string */ protected $filesName; /** * @link https://php.net/manual/en/class.mongogridfs.php#mongogridfs.props.chunksname * @var string */ protected $chunksName; /** * Files as stored across two collections, the first containing file meta * information, the second containing chunks of the actual file. By default, * fs.files and fs.chunks are the collection names used. * * @link https://php.net/manual/en/mongogridfs.construct.php * @param MongoDB $db Database * @param string $prefix [optional]Optional collection name prefix.
* @param mixed $chunks [optional] */ public function __construct($db, $prefix = "fs", $chunks = "fs") {} /** * Drops the files and chunks collections * @link https://php.net/manual/en/mongogridfs.drop.php * @return array The database response */ public function drop() {} /** * @link https://php.net/manual/en/mongogridfs.find.php * @param array $query The query * @param array $fields Fields to return * @return MongoGridFSCursor A MongoGridFSCursor */ public function find(array $query = [], array $fields = []) {} /** * Stores a file in the database * @link https://php.net/manual/en/mongogridfs.storefile.php * @param string|resource $filename The name of the file * @param array $extra Other metadata to add to the file saved * @param array $options Options for the store. "safe": Check that this store succeeded * @return mixed Returns the _id of the saved object */ public function storeFile($filename, $extra = [], $options = []) {} /** * Chunkifies and stores bytes in the database * @link https://php.net/manual/en/mongogridfs.storebytes.php * @param string $bytes A string of bytes to store * @param array $extra Other metadata to add to the file saved * @param array $options Options for the store. "safe": Check that this store succeeded * @return mixed The _id of the object saved */ public function storeBytes($bytes, $extra = [], $options = []) {} /** * Returns a single file matching the criteria * @link https://secure.php.net/manual/en/mongogridfs.findone.php * @param array $query The fields for which to search. * @param array $fields Fields of the results to return. * @return MongoGridFSFile|null */ public function findOne(array $query = [], array $fields = []) {} /** * Removes files from the collections * @link https://secure.php.net/manual/en/mongogridfs.remove.php * @param array $criteria Description of records to remove. * @param array $options Options for remove. Valid options are: "safe"- Check that the remove succeeded. * @throws MongoCursorException * @return bool */ public function remove(array $criteria = [], array $options = []) {} /** * Delete a file from the database * @link https://php.net/manual/en/mongogridfs.delete.php * @param mixed $id _id of the file to remove * @return bool Returns true if the remove was successfully sent to the database. */ public function delete($id) {} /** * Saves an uploaded file directly from a POST to the database * @link https://secure.php.net/manual/en/mongogridfs.storeupload.php * @param string $name The name attribute of the uploaded file, from<input type="file" name="something"/>
* @param array $metadata An array of extra fields for the uploaded file.
* @return mixed Returns the _id of the uploaded file.
*/
public function storeUpload($name, array $metadata = []) {}
/**
* Retrieve a file from the database
* @link https://secure.php.net/manual/en/mongogridfs.get.php
* @param mixed $id _id of the file to find.
* @return MongoGridFSFile|null Returns the file, if found, or NULL.
*/
public function get($id) {}
/**
* Stores a file in the database
* @link https://php.net/manual/en/mongogridfs.put.php
* @param string $filename The name of the file
* @param array $extra Other metadata to add to the file saved
* @return mixed Returns the _id of the saved object
*/
public function put($filename, array $extra = []) {}
}
class MongoGridFSFile
{
/**
* @link https://php.net/manual/en/class.mongogridfsfile.php#mongogridfsfile.props.file
* @var array|null
*/
public $file;
/**
* @link https://php.net/manual/en/class.mongogridfsfile.php#mongogridfsfile.props.gridfs
* @var MongoGridFS|null
*/
protected $gridfs;
/**
* @link https://php.net/manual/en/mongogridfsfile.construct.php
* @param MongoGridFS $gridfs The parent MongoGridFS instance
* @param array $file A file from the database
*/
public function __construct($gridfs, array $file) {}
/**
* Returns this file's filename
* @link https://php.net/manual/en/mongogridfsfile.getfilename.php
* @return string Returns the filename
*/
public function getFilename() {}
/**
* Returns this file's size
* @link https://php.net/manual/en/mongogridfsfile.getsize.php
* @return int Returns this file's size
*/
public function getSize() {}
/**
* Writes this file to the filesystem
* @link https://php.net/manual/en/mongogridfsfile.write.php
* @param string $filename The location to which to write the file (path+filename+extension). If none is given, the stored filename will be used.
* @return int Returns the number of bytes written
*/
public function write($filename = null) {}
/**
* This will load the file into memory. If the file is bigger than your memory, this will cause problems!
* @link https://php.net/manual/en/mongogridfsfile.getbytes.php
* @return string Returns a string of the bytes in the file
*/
public function getBytes() {}
/**
* This method returns a stream resource that can be used to read the stored file with all file functions in PHP.
* The contents of the file are pulled out of MongoDB on the fly, so that the whole file does not have to be loaded into memory first.
* At most two GridFSFile chunks will be loaded in memory.
*
* @link https://php.net/manual/en/mongogridfsfile.getresource.php
* @return resource Returns a resource that can be used to read the file with
*/
public function getResource() {}
}
class MongoGridFSCursor extends MongoCursor implements Traversable, Iterator
{
/**
* @var bool
*/
public static $slaveOkay;
/**
* @link https://php.net/manual/en/class.mongogridfscursor.php#mongogridfscursor.props.gridfs
* @var MongoGridFS|null
*/
protected $gridfs;
/**
* Create a new cursor
* @link https://php.net/manual/en/mongogridfscursor.construct.php
* @param MongoGridFS $gridfs Related GridFS collection
* @param resource $connection Database connection
* @param string $ns Full name of database and collection
* @param array $query Database query
* @param array $fields Fields to return
*/
public function __construct($gridfs, $connection, $ns, $query, $fields) {}
/**
* Return the next file to which this cursor points, and advance the cursor
* @link https://php.net/manual/en/mongogridfscursor.getnext.php
* @return MongoGridFSFile Returns the next file
*/
public function getNext() {}
/**
* Returns the current file
* @link https://php.net/manual/en/mongogridfscursor.current.php
* @return MongoGridFSFile The current file
*/
public function current() {}
/**
* Returns the current result's filename
* @link https://php.net/manual/en/mongogridfscursor.key.php
* @return string The current results filename
*/
public function key() {}
}
/**
* A unique identifier created for database objects.
* @link https://secure.php.net/manual/en/class.mongoid.php
*/
class MongoId
{
/**
* @var string Note: The property name begins with a $ character. It may be accessed using * {@link https://php.net/manual/en/language.types.string.php#language.types.string.parsing.complex complex variable parsed syntax} (e.g. $mongoId->{'$id'}).
*/ public $id = null; /** * (PECL mongo >= 0.8.0) * Creates a new id * @link https://secure.php.net/manual/en/mongoid.construct.php * @param MongoId|string $id [optional] A string to use as the id. Must be 24 hexadecimal characters. If an invalid string is passed to this constructor, the constructor will ignore it and create a new id value. */ public function __construct($id = null) {} /** * (PECL mongo >= 0.8.0) * Check if a value is a valid ObjectId * @link https://php.net/manual/en/mongoid.isvalid.php * @param mixed $value The value to check for validity. * @return bool* Returns TRUE if value is a * MongoId instance or a string consisting of exactly 24 * hexadecimal characters; otherwise, FALSE is returned. *
*/ public static function isValid($value) {} /** * (PECL mongo >= 0.8.0) * Returns a hexadecimal representation of this id * @link https://secure.php.net/manual/en/mongoid.tostring.php * @return string This id. */ public function __toString() {} /** * (PECL mongo >= 1.0.11) * Gets the incremented value to create this id * @link https://php.net/manual/en/mongoid.getinc.php * @return int Returns the incremented value used to create this MongoId. */ public function getInc() {} /** * (PECL mongo >= 1.0.11) * Gets the process ID * @link https://php.net/manual/en/mongoid.getpid.php * @return int Returns the PID of the MongoId. */ public function getPID() {} /** * (PECL mongo >= 1.0.1) * Gets the number of seconds since the epoch that this id was created * @link https://secure.php.net/manual/en/mongoid.gettimestamp.php * @return int */ public function getTimestamp() {} /** * (PECL mongo >= 1.0.8) * Gets the hostname being used for this machine's ids * @link https://secure.php.net/manual/en/mongoid.gethostname.php * @return string Returns the hostname. */ public static function getHostname() {} /** * (PECL mongo >= 1.0.8) * Create a dummy MongoId * @link https://php.net/manual/en/mongoid.set-state.php * @param array $propsTheoretically, an array of properties used to create the new id. However, as MongoId instances have no properties, this is not used.
* @return MongoId A new id with the value "000000000000000000000000". */ public static function __set_state(array $props) {} } class MongoCode { /** * @var string */ public $code; /** * @var array */ public $scope; /** * . * * @link https://php.net/manual/en/mongocode.construct.php * @param string $code A string of code * @param array $scope The scope to use for the code */ public function __construct($code, array $scope = []) {} /** * Returns this code as a string * @return string */ public function __toString() {} } class MongoRegex { /** * @link https://php.net/manual/en/class.mongoregex.php#mongoregex.props.regex * @var string */ public $regex; /** * @link https://php.net/manual/en/class.mongoregex.php#mongoregex.props.flags * @var string */ public $flags; /** * Creates a new regular expression. * * @link https://php.net/manual/en/mongoregex.construct.php * @param string $regex Regular expression string of the form /expr/flags */ public function __construct($regex) {} /** * Returns a string representation of this regular expression. * @return string This regular expression in the form "/expr/flags". */ public function __toString() {} } class MongoDate { /** * @link https://php.net/manual/en/class.mongodate.php#mongodate.props.sec * @var int */ public $sec; /** * @link https://php.net/manual/en/class.mongodate.php#mongodate.props.usec * @var int */ public $usec; /** * Creates a new date. If no parameters are given, the current time is used. * * @link https://php.net/manual/en/mongodate.construct.php * @param int $sec Number of seconds since January 1st, 1970 * @param int $usec Microseconds */ public function __construct($sec = 0, $usec = 0) {} /** * Returns a DateTime object representing this date * @link https://php.net/manual/en/mongodate.todatetime.php * @return DateTime */ public function toDateTime() {} /** * Returns a string representation of this date * @return string */ public function __toString() {} } class MongoBinData { /** * Generic binary data. * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom */ public const GENERIC = 0x0; /** * Function * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.func */ public const FUNC = 0x1; /** * Generic binary data (deprecated in favor of MongoBinData::GENERIC) * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.byte-array */ public const BYTE_ARRAY = 0x2; /** * Universally unique identifier (deprecated in favor of MongoBinData::UUID_RFC4122) * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.uuid */ public const UUID = 0x3; /** * Universally unique identifier (according to » RFC 4122) * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom */ public const UUID_RFC4122 = 0x4; /** * MD5 * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.md5 */ public const MD5 = 0x5; /** * User-defined type * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.constants.custom */ public const CUSTOM = 0x80; /** * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.props.bin * @var string */ public $bin; /** * @link https://php.net/manual/en/class.mongobindata.php#mongobindata.props.type * @var int */ public $type; /** * Creates a new binary data object. * * @link https://php.net/manual/en/mongobindata.construct.php * @param string $data Binary data * @param int $type Data type */ public function __construct($data, $type = 2) {} /** * Returns the string representation of this binary data object. * @return string */ public function __toString() {} } class MongoDBRef { /** * @var string */ protected static $refKey = '$ref'; /** * @var string */ protected static $idKey = '$id'; /** * If no database is given, the current database is used. * * @link https://php.net/manual/en/mongodbref.create.php * @param string $collection Collection name (without the database name) * @param mixed $id The _id field of the object to which to link * @param string $database Database name * @return array Returns the reference */ public static function create($collection, $id, $database = null) {} /** * This not actually follow the reference, so it does not determine if it is broken or not. * It merely checks that $ref is in valid database reference format (in that it is an object or array with $ref and $id fields). * * @link https://php.net/manual/en/mongodbref.isref.php * @param mixed $ref Array or object to check * @return bool Returns true if $ref is a reference */ public static function isRef($ref) {} /** * Fetches the object pointed to by a reference * @link https://php.net/manual/en/mongodbref.get.php * @param MongoDB $db Database to use * @param array $ref Reference to fetch * @return array|null Returns the document to which the reference refers or null if the document does not exist (the reference is broken) */ public static function get($db, $ref) {} } class MongoWriteBatch { public const COMMAND_INSERT = 1; public const COMMAND_UPDATE = 2; public const COMMAND_DELETE = 3; /** *(PECL mongo >= 1.5.0)
* MongoWriteBatch constructor. * @link https://php.net/manual/en/mongowritebatch.construct.php * @param MongoCollection $collection The {@see MongoCollection} to execute the batch on. * Its {@link https://php.net/manual/en/mongo.writeconcerns.php write concern} * will be copied and used as the default write concern if none is given as$write_options
or during
* {@see MongoWriteBatch::execute()}.
* @param string $batch_type [optional] * One of: *
An array of Write Options.
key | value meaning |
---|---|
w (int|string) | {@link https://php.net/manual/en/mongo.writeconcerns.php Write concern} value |
wtimeout (int) | {@link https://php.net/manual/en/mongo.writeconcerns.php Maximum time to wait for replication} |
ordered | Determins if MongoDB must apply this batch in order (sequentally, one item at a time) or can rearrange it.
* Defaults to TRUE |
j (bool) | Wait for journaling on the primary. This value is discouraged, use WriteConcern instead |
fsync (bool) | Wait for fsync on the primary. This value is discouraged, use WriteConcern instead |
(PECL mongo >= 1.5.0)
* Adds a write operation to a batch * @link https://php.net/manual/en/mongowritebatch.add.php * @param array $item* An array that describes a write operation. The structure of this value * depends on the batch's operation type. *
Batch type | *Argument expectation | *
---|---|
MongoWriteBatch::COMMAND_INSERT |
* * The document to add. * | *
MongoWriteBatch::COMMAND_UPDATE |
*
* Raw update operation. *Required keys are "q" and "u", which correspond to the
* Optional keys are "multi" and "upsert", which correspond to the
* "multiple" and "upsert" options for {@see MongoCollection::update()}, respectively.
* If unspecified, both options default to |
*
MongoWriteBatch::COMMAND_DELETE |
*
* Raw delete operation. *Required keys are: "q" and "limit", which correspond to the The "limit" option is an integer; however, MongoDB only supports 0 (i.e. remove all matching * ocuments) and 1 (i.e. remove at most one matching document) at this time. * |
*
(PECL mongo >= 1.5.0)
* Executes a batch of write operations * @link https://php.net/manual/en/mongowritebatch.execute.php * @param array $write_options See {@see MongoWriteBatch::__construct} * @return array Returns an array containing statistical information for the full batch. * If the batch had to be split into multiple batches, the return value will aggregate the values from individual batches and return only the totals. * If the batch was empty, an array containing only the 'ok' field is returned (as TRUE) although nothing will be shipped over the wire (NOOP). */ final public function execute(array $write_options) {} } class MongoUpdateBatch extends MongoWriteBatch { /** *(PECL mongo >= 1.5.0)
* MongoUpdateBatch constructor. * @link https://php.net/manual/en/mongoupdatebatch.construct.php * @param MongoCollection $collectionThe MongoCollection to execute the batch on. * Its write concern will be copied and used as the default write concern * if none is given as $write_options or during {@see MongoWriteBatch::execute()}.
* @param array $write_optionsAn array of Write Options.
key | value meaning |
---|---|
w (int|string) | {@link https://php.net/manual/en/mongo.writeconcerns.php Write concern} value |
wtimeout (int) | {@link https://php.net/manual/en/mongo.writeconcerns.php Maximum time to wait for replication} |
ordered | Determins if MongoDB must apply this batch in order (sequentally, one item at a time) or can rearrange it. Defaults to TRUE |
j (bool) | Wait for journaling on the primary. This value is discouraged, use WriteConcern instead |
fsync (bool) | Wait for fsync on the primary. This value is discouraged, use WriteConcern instead |
(PECL mongo >= 1.5.0)
* @link https://php.net/manual/en/class.mongowriteconcernexception.php#class.mongowriteconcernexception */ class MongoWriteConcernException extends MongoCursorException { /** * Get the error document * @link https://php.net/manual/en/mongowriteconcernexception.getdocument.php * @return arrayA MongoDB document, if available, as an array.
*/ public function getDocument() {} } /** *(PECL mongo >= 1.5.0)
* @link https://php.net/manual/en/class.mongoexecutiontimeoutexception.php */ class MongoExecutionTimeoutException extends MongoException {} /** *(PECL mongo >= 1.5.0)
*/ class MongoProtocolException extends MongoException {} /** *(PECL mongo >= 1.5.0)
* @link https://php.net/manual/en/class.mongoduplicatekeyexception.php */ class MongoDuplicateKeyException extends MongoWriteConcernException {} /** *(PECL mongo >= 1.3.0)
* @link https://php.net/manual/en/class.mongoresultexception.php#mongoresultexception.props.document */ class MongoResultException extends MongoException { /** *(PECL mongo >= 1.3.0)
* Retrieve the full result document * https://secure.php.net/manual/en/mongoresultexception.getdocument.php * @return arrayThe full result document as an array, including partial data if available and additional keys.
*/ public function getDocument() {} public $document; } class MongoTimestamp { /** * @link https://php.net/manual/en/class.mongotimestamp.php#mongotimestamp.props.sec * @var int */ public $sec; /** * @link https://php.net/manual/en/class.mongotimestamp.php#mongotimestamp.props.inc * @var int */ public $inc; /** * Creates a new timestamp. If no parameters are given, the current time is used * and the increment is automatically provided. The increment is set to 0 when the * module is loaded and is incremented every time this constructor is called * (without the $inc parameter passed in). * * @link https://php.net/manual/en/mongotimestamp.construct.php * @param int $sec [optional] Number of seconds since January 1st, 1970 * @param int $inc [optional] Increment */ public function __construct($sec = 0, $inc) {} /** * @return string */ public function __toString() {} } class MongoInt32 { /** * @link https://php.net/manual/en/class.mongoint32.php#mongoint32.props.value * @var string */ public $value; /** * Creates a new 32-bit number with the given value. * * @link https://php.net/manual/en/mongoint32.construct.php * @param string $value A number */ public function __construct($value) {} /** * @return string */ public function __toString() {} } class MongoInt64 { /** * @link https://php.net/manual/en/class.mongoint64.php#mongoint64.props.value * @var string */ public $value; /** * Creates a new 64-bit number with the given value. * * @link https://php.net/manual/en/mongoint64.construct.php * @param string $value A number */ public function __construct($value) {} /** * @return string */ public function __toString() {} } class MongoLog { /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.none */ public const NONE = 0; /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.all */ public const ALL = 0; /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.warning */ public const WARNING = 0; /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.info */ public const INFO = 0; /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.fine */ public const FINE = 0; /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.rs */ public const RS = 0; /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.pool */ public const POOL = 0; /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.io */ public const IO = 0; /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.server */ public const SERVER = 0; /** * @link https://php.net/manual/en/class.mongolog.php#mongolog.constants.parse */ public const PARSE = 0; public const CON = 2; /** * (PECL mongo >= 1.3.0)* This function will set a callback function to be called for {@link https://secure.php.net/manual/en/class.mongolog.php MongoLog} events * instead of triggering warnings. *
* @link https://secure.php.net/manual/en/mongolog.setcallback.php * @param callable $log_function* The function to be called on events. *
** The function should have the following prototype *
* * log_function ( int $module , int $level, string $message) *One of the {@link https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.module MongoLog module constants}.
*One of the {@link https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.level MongoLog level constants}.
*The log message itself.