* 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}. *

* @throws MongoConnectionException */ public function __construct($server = "mongodb://localhost:27017", array $options = ["connect" => true], $driver_options) {} /** * (PECL mongo >= 1.3.0)
* Closes this database connection * This method does not need to be called, except in unusual circumstances. * The driver will cleanly close the database connection when the Mongo object goes out of scope. * @link https://secure.php.net/manual/en/mongoclient.close.php * @param bool|string $connection [optional]

* 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)
* Gets a database * @link https://php.net/manual/en/mongoclient.get.php * @param string $dbname The database name. * @return MongoDB The database name. */ public function __get($dbname) {} /** * Get connections * Returns an array of all open connections, and information about each of the servers * @return array */ public static function getConnections() {} /** * Get hosts * This method is only useful with a connection to a replica set. It returns the status of all of the hosts in the * set. Without a replica set, it will just return an array with one element containing the host that you are * connected to. * @return array */ public function getHosts() {} /** * Get read preference * Get the read preference for this connection * @return array */ public function getReadPreference() {} /** * (PECL mongo >= 1.5.0)
* Get the write concern for this connection * @return array

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)
* Lists all of the databases available * @link https://php.net/manual/en/mongoclient.listdbs.php * @return array Returns an associative array containing three fields. The first field is databases, which in turn contains an array. Each element of the array is an associative array corresponding to a database, giving the database's name, size, and if it's empty. The other two fields are totalSize (in bytes) and ok, which is 1 if this method ran successfully. */ public function listDBs() {} /** * (PECL mongo >= 1.3.0)
* Gets a database collection * @link https://secure.php.net/manual/en/mongoclient.selectcollection.php * @param string $db The database name. * @param string $collection The collection name. * @throws Exception Throws Exception if the database or collection name is invalid. * @return MongoCollection Returns a new collection object. */ public function selectCollection($db, $collection) {} /** * (PECL mongo >= 1.3.0)
* Gets a database * @link https://secure.php.net/manual/en/mongo.selectdb.php * @param string $name The database name. * @throws InvalidArgumentException * @return MongoDB Returns a new db object. */ public function selectDB($name) {} /** * (PECL mongo >= 1.3.0)
* Set read preference * @param string $readPreference * @param array $tags * @return bool */ public function setReadPreference($readPreference, $tags = null) {} /** * (PECL mongo >= 1.1.0)
* Choose a new secondary for slaveOkay reads * @link https://secure.php.net/manual/en/mongo.switchslave.php * @return string The address of the secondary this connection is using for reads. This may be the same as the previous address as addresses are randomly chosen. It may return only one address if only one secondary (or only the primary) is available. * For example, if we had a three member replica set with a primary, secondary, and arbiter this method would always return the address of the secondary. If the secondary became unavailable, this method would always return the address of the primary. If the primary also became unavailable, this method would throw an exception, as an arbiter cannot handle reads. * @throws MongoException (error code 15) if it is called on a non-replica-set connection. It will also throw MongoExceptions if it cannot find anyone (primary or secondary) to read from (error code 16). */ public function switchSlave() {} /** * String representation of this connection * @link https://secure.php.net/manual/en/mongoclient.tostring.php * @return string Returns hostname and port for this connection. */ public function __toString() {} } /** * The connection point between MongoDB and PHP. * This class is used to initiate a connection and for database server commands. * @link https://secure.php.net/manual/en/class.mongo.php * Relying on this feature is highly discouraged. Please use MongoClient instead. * @see MongoClient */ #[Deprecated("This class has been DEPRECATED as of version 1.3.0.")] class Mongo extends MongoClient { /** * (PECL mongo >= 1.2.0)
* Get pool size for connection pools * @link https://php.net/manual/en/mongo.getpoolsize.php * @return int Returns the current pool size. * @see MongoPool::getSize() */ #[Deprecated('This feature has been DEPRECATED as of version 1.2.3. Relying on this feature is highly discouraged. Please use MongoPool::getSize() instead.')] public function getPoolSize() {} /** * (PECL mongo >= 1.1.0)
* Returns the address being used by this for slaveOkay reads * @link https://php.net/manual/en/mongo.getslave.php * @return bool

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)
* Get slaveOkay setting for this connection * @link https://php.net/manual/en/mongo.getslaveokay.php * @return bool Returns the value of slaveOkay for this instance. */ public function getSlaveOkay() {} /** * Connects to paired database server * @link https://secure.php.net/manual/en/mongo.pairconnect.php * @throws MongoConnectionException * @return bool */ #[Deprecated('Pass a string of the form "mongodb://server1,server2" to the constructor instead of using this method.')] public function pairConnect() {} /** * (PECL mongo >= 1.2.0)
* Returns information about all connection pools. * @link https://php.net/manual/en/mongo.pooldebug.php * @return array Each connection pool has an identifier, which starts with the host. For each pool, this function shows the following fields: *

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)
* Change slaveOkay setting for this connection * @link https://php.net/manual/en/mongo.setslaveokay.php * @param bool $ok [optional]

* 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)
* Set the size for future connection pools. * @link https://php.net/manual/en/mongo.setpoolsize.php * @param int $size

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)
* Creates a new database * This method is not meant to be called directly. The preferred way to create an instance of MongoDB is through {@see Mongo::__get()} or {@see Mongo::selectDB()}. * @link https://secure.php.net/manual/en/mongodb.construct.php * @param MongoClient $conn Database connection. * @param string $name Database name. * @throws Exception */ public function __construct($conn, $name) {} /** * The name of this database * @link https://secure.php.net/manual/en/mongodb.--tostring.php * @return string Returns this database's name. */ public function __toString() {} /** * (PECL mongo >= 1.0.2)
* Gets a collection * @link https://secure.php.net/manual/en/mongodb.get.php * @param string $name The name of the collection. * @return MongoCollection */ public function __get($name) {} /** * (PECL mongo >= 1.3.0)
* @link https://secure.php.net/manual/en/mongodb.getcollectionnames.php * Get all collections from this database * @param bool $includeSystemCollections [optional] Include system collections. * @return array Returns the names of the all the collections in the database as an * {@link https://secure.php.net/manual/en/language.types.array.php array}. */ public function getCollectionNames($includeSystemCollections = false) {} /** * (PECL mongo >= 0.9.0)
* Fetches toolkit for dealing with files stored in this database * @link https://secure.php.net/manual/en/mongodb.getgridfs.php * @param string $prefix [optional] The prefix for the files and chunks collections. * @return MongoGridFS Returns a new gridfs object for this database. */ public function getGridFS($prefix = "fs") {} /** * (PECL mongo >= 0.9.0)
* Gets this database's profiling level * @link https://secure.php.net/manual/en/mongodb.getprofilinglevel.php * @return int Returns the profiling level. */ public function getProfilingLevel() {} /** * (PECL mongo >= 1.1.0)
* Get slaveOkay setting for this database * @link https://secure.php.net/manual/en/mongodb.getslaveokay.php * @return bool Returns the value of slaveOkay for this instance. */ public function getSlaveOkay() {} /** * (PECL mongo >= 0.9.0)
* Sets this database's profiling level * @link https://secure.php.net/manual/en/mongodb.setprofilinglevel.php * @param int $level Profiling level. * @return int Returns the previous profiling level. */ public function setProfilingLevel($level) {} /** * (PECL mongo >= 0.9.0)
* Drops this database * @link https://secure.php.net/manual/en/mongodb.drop.php * @return array Returns the database response. */ public function drop() {} /** * Repairs and compacts this database * @link https://secure.php.net/manual/en/mongodb.repair.php * @param bool $preserve_cloned_files [optional]

If cloned files should be kept if the repair fails.

* @param bool $backup_original_files [optional]

If original files should be backed up.

* @return array

Returns db response.

*/ public function repair($preserve_cloned_files = false, $backup_original_files = false) {} /** * (PECL mongo >= 0.9.0)
* Gets a collection * @link https://secure.php.net/manual/en/mongodb.selectcollection.php * @param string $name The collection name. * @throws Exception if the collection name is invalid. * @return MongoCollection

* Returns a new collection object. *

*/ public function selectCollection($name) {} /** * (PECL mongo >= 1.1.0)
* Change slaveOkay setting for this database * @link https://php.net/manual/en/mongodb.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.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 MongoCollection

Returns a collection object representing the new collection.

*/ public function createCollection($name, $options) {} /** * (PECL mongo >= 0.9.0)
* Drops a collection * @link https://secure.php.net/manual/en/mongodb.dropcollection.php * @param MongoCollection|string $coll MongoCollection or name of collection to drop. * @return array Returns the database response. * @see MongoCollection::drop() */ #[Deprecated('Use MongoCollection::drop() instead.')] public function dropCollection($coll) {} /** * (PECL mongo >= 0.9.0)
* Get a list of collections in this database * @link https://secure.php.net/manual/en/mongodb.listcollections.php * @param bool $includeSystemCollections [optional]

Include system collections.

* @return array Returns a list of MongoCollections. */ public function listCollections($includeSystemCollections = false) {} /** * (PECL mongo >= 0.9.0)
* Creates a database reference * @link https://secure.php.net/manual/en/mongodb.createdbref.php * @param string $collection The collection to which the database reference will point. * @param mixed $document_or_id

* 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 array

Returns 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)
* Fetches the document pointed to by a database reference * @link https://secure.php.net/manual/en/mongodb.getdbref.php * @param array $ref A database reference. * @return array Returns the document pointed to by the reference. */ public function getDBRef(array $ref) {} /** * (PECL mongo >= 1.5.0)
* Get the write concern for this database * @link https://php.net/manual/en/mongodb.getwriteconcern.php * @return array

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)
* Runs JavaScript code on the database server. * @link https://secure.php.net/manual/en/mongodb.execute.php * @param MongoCode|string $code Code to execute. * @param array $args [optional] Arguments to be passed to code. * @return array Returns the result of the evaluation. */ public function execute($code, array $args = []) {} /** * Execute a database command * @link https://secure.php.net/manual/en/mongodb.command.php * @param array $data The query to send. * @param array $options [optional]

* This parameter is an associative array of the form * array("optionname" => <boolean>, ...). Currently * supported options are: *

* @return array Returns database response. * Every database response is always maximum one document, * which means that the result of a database command can never exceed 16MB. * The resulting document's structure depends on the command, * but most results will have the ok field to indicate success or failure and results containing an array of each of the resulting documents. */ public function command(array $data, $options) {} /** * (PECL mongo >= 0.9.5)
* Check if there was an error on the most recent db operation performed * @link https://secure.php.net/manual/en/mongodb.lasterror.php * @return array Returns the error, if there was one. */ public function lastError() {} /** * (PECL mongo >= 0.9.5)
* Checks for the last error thrown during a database operation * @link https://secure.php.net/manual/en/mongodb.preverror.php * @return array Returns the error and the number of operations ago it occurred. */ public function prevError() {} /** * (PECL mongo >= 0.9.5)
* Clears any flagged errors on the database * @link https://secure.php.net/manual/en/mongodb.reseterror.php * @return array Returns the database response. */ public function resetError() {} /** * (PECL mongo >= 0.9.5)
* Creates a database error * @link https://secure.php.net/manual/en/mongodb.forceerror.php * @return bool Returns the database response. */ public function forceError() {} /** * (PECL mongo >= 1.0.1)
* Log in to this database * * @link https://secure.php.net/manual/en/mongodb.authenticate.php * * @param string $username The username. * @param string $password The password (in plaintext). * * @return array

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)
* Get the read preference for this database * @link https://secure.php.net/manual/en/mongodb.getreadpreference.php * @return array This function returns an array describing the read preference. The array contains the values type for the string read preference mode (corresponding to the MongoClient constants), and tagsets containing a list of all tag set criteria. If no tag sets were specified, tagsets will not be present in the array. */ public function getReadPreference() {} /** * (PECL mongo >= 1.3.0)
* Set the read preference for this database * @link https://secure.php.net/manual/en/mongodb.setreadpreference.php * @param string $read_preference

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)
* @link https://php.net/manual/en/mongodb.setwriteconcern.php * Set the write concern for this database * @param mixed $w

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 $pipeline

An 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 $pipeline

The 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)
* @link https://secure.php.net/manual/en/mongocollection.getreadpreference.php * @return array This function returns an array describing the read preference. The array contains the values type for the string read preference mode * (corresponding to the {@link https://secure.php.net/manual/en/class.mongoclient.php MongoClient} constants), and tagsets containing a list of all tag set criteria. If no tag sets were specified, tagsets will not be present in the array. */ public function getReadPreference() {} /** * (PECL mongo >= 1.3.0)
* @param string $read_preference

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. *

*
"w"
*
See WriteConcerns. The default value for MongoClient is 1.
*
"fsync"
*
Boolean, defaults to FALSE. Forces the insert to be synced to disk before returning success. If TRUE, an acknowledged insert is implied and will override setting w to 0.
*
"timeout"
*
Integer, defaults to MongoCursor::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does not respond within the timeout period, a MongoCursorTimeoutException will be thrown.
*
"safe"
*
Deprecated. Please use the WriteConcern w option.
*
* @throws MongoException if the inserted document is empty or if it contains zero-length keys. Attempting to insert an object with protected and private properties will cause a zero-length key error. * @throws MongoCursorException if the "w" option is set and the write fails. * @throws MongoCursorTimeoutException if the "w" option is set to a value greater than one and the operation takes longer than MongoCursor::$timeout milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in MongoCollection::$wtimeout is milliseconds. * @return bool|array Returns an array containing the status of the insertion if the "w" option is set. * Otherwise, returns TRUE if the inserted array is not empty (a MongoException will be thrown if the inserted array is empty). * If an array is returned, the following keys may be present: *
*
ok
*
This should almost be 1 (unless last_error itself failed).
*
err
*
If this field is non-null, an error occurred on the previous operation. If this field is set, it will be a string describing the error that occurred.
*
code
*
If a database error occurred, the relevant error code will be passed back to the client.
*
errmsg
*
This field is set if something goes wrong with a database command. It is coupled with ok being 0. For example, if w is set and times out, errmsg will be set to "timed out waiting for slaves" and ok will be 0. If this field is set, it will be a string describing the error that occurred.
*
n
*
If the last operation was an update, upsert, or a remove, the number of documents affected will be returned. For insert operations, this value is always 0.
*
wtimeout
*
If the previous option timed out waiting for replication.
*
waited
*
How long the operation waited before timing out.
*
wtime
*
If w was set and the operation succeeded, how long it took to replicate to w servers.
*
upserted
*
If an upsert occurred, this field will contain the new record's _id field. For upserts, either this field or updatedExisting will be present (unless an error occurred).
*
updatedExisting
*
If an upsert updated an existing element, this field will be true. For upserts, either this field or upserted will be present (unless an error occurred).
*
*/ public function insert($a, array $options = []) {} /** * Inserts multiple documents into this collection * @link https://secure.php.net/manual/en/mongocollection.batchinsert.php * @param array $a An array of arrays. * @param array $options Options for the inserts. * @throws MongoCursorException * @return array|bool if "safe" is set, returns an associative array with the status of the inserts ("ok") and any error that may have occurred ("err"). Otherwise, returns TRUE if the batch insert was successfully sent, FALSE otherwise. */ public function batchInsert(array $a, array $options = []) {} /** * Update records based on a given criteria * @link https://secure.php.net/manual/en/mongocollection.update.php * @param array $criteria Description of the objects to update. * @param array $newobj The object with which to update the matching records. * @param array $options This parameter is an associative array of the form * array("optionname" => boolean, ...). * * Currently supported options are: * "upsert": If no document matches $$criteria, a new document will be created from $$criteria and $$new_object (see upsert example). * * "multiple": All documents matching $criteria will be updated. MongoCollection::update has exactly the opposite behavior of MongoCollection::remove- it updates one document by * default, not all matching documents. It is recommended that you always specify whether you want to update multiple documents or a single document, as the * database may change its default behavior at some point in the future. * * "safe" Can be a boolean or integer, defaults to false. If false, the program continues executing without waiting for a database response. If true, the program will wait for * the database response and throw a MongoCursorException if the update did not succeed. If you are using replication and the master has changed, using "safe" will make the driver * disconnect from the master, throw and exception, and attempt to find a new master on the next operation (your application must decide whether or not to retry the operation on the new master). * If you do not use "safe" with a replica set and the master changes, there will be no way for the driver to know about the change so it will continuously and silently fail to write. * If safe is an integer, will replicate the update to that many machines before returning success (or throw an exception if the replication times out, see wtimeout). * This overrides the w variable set on the collection. * * "fsync": Boolean, defaults to false. Forces the update to be synced to disk before returning success. If true, a safe update is implied and will override setting safe to false. * * "timeout" Integer, defaults to MongoCursor::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does * not respond within the timeout period, a MongoCursorTimeoutException will be thrown * @throws MongoCursorException * @return bool */ public function update(array $criteria, array $newobj, array $options = []) {} /** * (PECL mongo >= 0.9.0)
* Remove records from this collection * @link https://secure.php.net/manual/en/mongocollection.remove.php * @param array $criteria [optional]

Query criteria for the documents to delete.

* @param array $options [optional]

An array of options for the remove operation. Currently available options * include: *

* *

* The following options are deprecated and should no longer be used: *

* @throws MongoCursorException * @throws MongoCursorTimeoutException * @return bool|array

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" => ``, ...). * @return array|null */ public function findOne(array $query = [], array $fields = [], array $options = []) {} /** * Creates an index on the given field(s), or does nothing if the index already exists * @link https://secure.php.net/manual/en/mongocollection.createindex.php * @param array $keys Field or fields to use as index. * @param array $options [optional] This parameter is an associative array of the form array("optionname" => ``, ...). * @return array Returns the database response. */ public function createIndex(array $keys, array $options = []) {} /** * Creates an index on the given field(s), or does nothing if the index already exists * @link https://secure.php.net/manual/en/mongocollection.ensureindex.php * @param array $keys Field or fields to use as index. * @param array $options [optional] This parameter is an associative array of the form array("optionname" => ``, ...). * @return true always true * @see MongoCollection::createIndex() */ #[Deprecated('Use MongoCollection::createIndex() instead.')] public function ensureIndex(array $keys, array $options = []) {} /** * Deletes an index from this collection * @link https://secure.php.net/manual/en/mongocollection.deleteindex.php * @param string|array $keys Field or fields from which to delete the index. * @return array Returns the database response. */ public function deleteIndex($keys) {} /** * Delete all indexes for this collection * @link https://secure.php.net/manual/en/mongocollection.deleteindexes.php * @return array Returns the database response. */ public function deleteIndexes() {} /** * Returns an array of index names for this collection * @link https://secure.php.net/manual/en/mongocollection.getindexinfo.php * @return array Returns a list of index names. */ public function getIndexInfo() {} /** * Counts the number of documents in this collection * @link https://secure.php.net/manual/en/mongocollection.count.php * @param array|stdClass $query * @return int Returns the number of documents matching the query. */ public function count($query = []) {} /** * Saves an object to this collection * @link https://secure.php.net/manual/en/mongocollection.save.php * @param array|object $a Array to save. 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. * See MongoCollection::insert() for additional information on this behavior. * @param array $options Options for the save. *
*
"w" *
See WriteConcerns. The default value for MongoClient is 1. *
"fsync" *
Boolean, defaults to FALSE. Forces the insert to be synced to disk before returning success. If TRUE, an acknowledged insert is implied and will override setting w to 0. *
"timeout" *
Integer, defaults to MongoCursor::$timeout. If "safe" is set, this sets how long (in milliseconds) for the client to wait for a database response. If the database does not respond within the timeout period, a MongoCursorTimeoutException will be thrown. *
"safe" *
Deprecated. Please use the WriteConcern w option. *
* @throws MongoException if the inserted document is empty or if it contains zero-length keys. Attempting to insert an object with protected and private properties will cause a zero-length key error. * @throws MongoCursorException if the "w" option is set and the write fails. * @throws MongoCursorTimeoutException if the "w" option is set to a value greater than one and the operation takes longer than MongoCursor::$timeout milliseconds to complete. This does not kill the operation on the server, it is a client-side timeout. The operation in MongoCollection::$wtimeout is milliseconds. * @return array|bool If w was set, returns an array containing the status of the save. * Otherwise, returns a boolean representing if the array was not empty (an empty array will not be inserted). */ public function save($a, array $options = []) {} /** * Creates a database reference * @link https://secure.php.net/manual/en/mongocollection.createdbref.php * @param array $a Object to which to create a reference. * @return array Returns a database reference array. */ public function createDBRef(array $a) {} /** * Fetches the document pointed to by a database reference * @link https://secure.php.net/manual/en/mongocollection.getdbref.php * @param array $ref A database reference. * @return array Returns the database document pointed to by the reference. */ public function getDBRef(array $ref) {} /** * @param mixed $keys * @return string */ protected static function toIndexString($keys) {} /** * Performs an operation similar to SQL's GROUP BY command * @link https://secure.php.net/manual/en/mongocollection.group.php * @param mixed $keys Fields to group by. If an array or non-code object is passed, it will be the key used to group results. * @param array $initial Initial value of the aggregation counter object. * @param MongoCode $reduce A function that aggregates (reduces) the objects iterated. * @param array $condition An condition that must be true for a row to be considered. * @return array */ public function group($keys, array $initial, MongoCode $reduce, array $condition = []) {} } /** * Result object for database query. * @link https://secure.php.net/manual/en/class.mongocursor.php */ class MongoCursor implements Iterator { /** * @link https://php.net/manual/en/class.mongocursor.php#mongocursor.props.slaveokay * @var bool */ public static $slaveOkay = false; /** * @var int

* 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)
* Sets whether this cursor will wait for a while for a tailable cursor to return more data * @param bool $wait [optional]

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)
* @link https://secure.php.net/manual/en/mongocursor.getreadpreference.php * @return array This function returns an array describing the read preference. The array contains the values type for the string * read preference mode (corresponding to the {@link https://secure.php.net/manual/en/class.mongoclient.php MongoClient} constants), and tagsets containing a list of all tag set criteria. If no tag sets were specified, tagsets will not be present in the array. */ public function getReadPreference() {} /** * Limits the number of results returned * @link https://secure.php.net/manual/en/mongocursor.limit.php * @param int $num The number of results to return. * @throws MongoCursorException * @return MongoCursor Returns this cursor */ public function limit($num) {} /** * (PECL mongo >= 1.2.0)
* @link https://secure.php.net/manual/en/mongocursor.partial.php * @param bool $okay [optional]

If receiving partial results is okay.

* @return MongoCursor Returns this cursor. */ public function partial($okay = true) {} /** * (PECL mongo >= 1.2.1)
* @link https://secure.php.net/manual/en/mongocursor.setflag.php * @param int $flag

* 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)
* @link https://secure.php.net/manual/en/mongocursor.setreadpreference.php * @param string $read_preference

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 $props

Theoretically, 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: *

    *
  • 0 - make an MongoWriteBatch::COMMAND_INSERT batch
  • *
  • 1 - make an MongoWriteBatch::COMMAND_UPDATE batch
  • *
  • 2 - make a MongoWriteBatch::COMMAND_DELETE batch
  • *
* @param array $write_options [optional] *

An array of Write Options.

* * * * * * *
keyvalue 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}
orderedDetermins 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
*/ protected function __construct($collection, $batch_type, $write_options) {} /** *

(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 typeArgument expectation
MongoWriteBatch::COMMAND_INSERT * The document to add. *
MongoWriteBatch::COMMAND_UPDATE *

Raw update operation.

*

Required keys are "q" and "u", which correspond to the * $criteria and $new_object parameters of {@see MongoCollection::update()}, respectively.

*

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 FALSE.

*
MongoWriteBatch::COMMAND_DELETE *

Raw delete operation.

*

Required keys are: "q" and "limit", which correspond to the $criteria parameter * and "justOne" option of {@see MongoCollection::remove()}, respectively.

*

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.

*
* @return bool Returns TRUE on success and throws an exception on failure. */ public function add(array $item) {} /** *

(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 $collection

The 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_options

An array of Write Options.

* * * * * * *
keyvalue 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}
orderedDetermins 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
*/ public function __construct(MongoCollection $collection, array $write_options) {} } class MongoException extends Exception {} class MongoCursorException extends MongoException {} class MongoCursorTimeoutException extends MongoCursorException {} class MongoConnectionException extends MongoException {} class MongoGridFSException extends MongoException {} /** *

(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 array

A 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 array

The 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) *
    *
  • * module * *

    One of the {@link https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.module MongoLog module constants}.

    *
  • *
  • * level * *

    One of the {@link https://secure.php.net/manual/en/class.mongolog.php#mongolog.constants.level MongoLog level constants}.

    *
  • *
  • * message * *

    The log message itself.

  • *
      * @return bool Returns TRUE on success or FALSE on failure. */ public static function setCallback(callable $log_function) {} /** * This function can be used to set how verbose logging should be and the types of * activities that should be logged. Use the constants described in the MongoLog * section with bitwise operators to specify levels. * * @link https://php.net/manual/en/mongolog.setlevel.php * @param int $level The levels you would like to log * @return void */ public static function setLevel($level) {} /** * This can be used to see the log level. Use the constants described in the * MongoLog section with bitwise operators to check the level. * * @link https://php.net/manual/en/mongolog.getlevel.php * @return int Returns the current level */ public static function getLevel() {} /** * This function can be used to set which parts of the driver's functionality * should be logged. Use the constants described in the MongoLog section with * bitwise operators to specify modules. * * @link https://php.net/manual/en/mongolog.setmodule.php * @param int $module The module(s) you would like to log * @return void */ public static function setModule($module) {} /** * This function can be used to see which parts of the driver's functionality are * being logged. Use the constants described in the MongoLog section with bitwise * operators to check if specific modules are being logged. * * @link https://php.net/manual/en/mongolog.getmodule.php * @return int Returns the modules currently being logged */ public static function getModule() {} } class MongoPool { /** * Returns an array of information about all connection pools. * * @link https://php.net/manual/en/mongopool.info.php * @return array Each connection pool has an identifier, which starts with the host. For * each pool, this function shows the following fields: $in use The number of * connections currently being used by Mongo 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 Mongo before we exhausted this pool (assuming no instances of Mongo * 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. * $total The total number of connections allowed for this pool. This should be * greater than or equal to "in use" + "in pool" (or -1). $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. $waiting If you have * capped the pool size, workers requesting connections from the pool may block * until other workers return their connections. This field shows how many * milliseconds workers have blocked for connections to be released. If this number * keeps increasing, you may want to use MongoPool::setSize to add more connections * to your pool */ public static function info() {} /** * Sets the max number of connections new pools will be able to create. * * @link https://php.net/manual/en/mongopool.setsize.php * @param int $size 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 */ public static function setSize($size) {} /** * . * * @link https://php.net/manual/en/mongopool.getsize.php * @return int Returns the current pool size */ public static function getSize() {} } class MongoMaxKey {} class MongoMinKey {}