downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

Autenticación> <Tabla de correlación de SQL a Mongo
[edit] Last updated: Fri, 07 Jun 2013

view this page in

Conexión

Tabla de contenidos

La conexión a MongoDB es tan fácil como usar new MongoClient, pero hay muchas más opciones y configuraciones adicionales. La documentación para Mongo::__construct() cubre todas las opciones de la API, pero está página ofrece más detalles y consejos para casos de uso prácticos.



Autenticación> <Tabla de correlación de SQL a Mongo
[edit] Last updated: Fri, 07 Jun 2013
 
add a note add a note User Contributed Notes Conexión - [3 notes]
up
4
Anonymous
6 months ago
The whole part of persistent connections is outdated. In version 1.3.0:

«Removed the "persist" option, as all connections are now persistent. It can still be used, but it doesn't affect anything.»

As a matter of fact, this note is also wrong. Using option "persist" will throw an

Uncaught exception 'MongoConnectionException' with message '- Found unknown connection string option 'persist' with value 'x'
up
0
james at dunmore dot me dot uk
10 months ago
We've got a strange gotcha (it maybe a bug with the mongo driver and we will raise an appropriate bug with them), but I think this is worth noting here.....

We were connecting to a replica set, but always getting "couldn't determine master" being returned. Connecting to individual notes without replicaset being set worked fine (directly to the master, or slave okay for reads). Replicaset working fine, and all setup okay.

The issue was our network setup, despite being able to resolve dbname-X.domain.com the server names were returning as dbname-X without the domain.

Pinging dbname-X worked, but for some reason the driver isn't resolving it. Adding the entry to hosts fixed this though.
up
-1
daveg at smartbombinteractive dot com
5 months ago
I was getting "couldn't determine master" when trying to connect to a replica set.  It turns out there was a typo in my /etc/hosts entry for on of the replica set members.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites