Mongo
PHP Manual

Mongo::close

(PECL mongo >=0.9.0)

Mongo::closeCloses this connection

Описание

public bool Mongo::close ( void )

The Mongo::close() method forcefully closes a connection to the database, even if persistent connections are being used. You do under normal circumstance never have to do this.

If you are connected to a replica set, close() will only close the connection to the primary.

Список параметров

У этой функции нет параметров.

Возвращаемые значения

Returns if the connection was successfully closed.

Список изменений

Версия Описание
1.2.0

Before version 1.2.0 the driver would not use persistent connections by default, and all connections would be closed as soon as a MongoDB connection went out if scope. Since version 1.2.0 this is no longer the case and it is a bad idea to call close as you might end up overloading the server with connections under high load.


Mongo
PHP Manual