MongoClient::connect

(PECL mongo >=1.3.0)

MongoClient::connectOuvre une connexion au serveur de base de données

Description

public MongoClient::connect ( void ) : bool

Liste de paramètres

Cette fonction ne contient aucun paramètre.

Valeurs de retour

Si la connexion a réussi.

Erreurs / Exceptions

Émet une exception MongoConnectionException si la connexion à la base de données échoue.

add a note add a note

User Contributed Notes 1 note

up
0
East Ghost Com
8 years ago
(driver) mongo-1.6.14

throws exception

"Database name cannot exceed 63 characters"

whenever it gets a string over 63 chars.

Looking at MongoClient using ReflectionMethod, MongoClient describes itself as having been passed a string containing every server that itself has determined exists in your replicaset.  In other words, if there are 26 servers, MongoClient (using ReflectionMethod) returns its own (supposed) 'connect string' as (in our specific case) having over 397 characters!   So, essentially, it returns data about itself that it was never passed, but rather figured out about itself after invocation.

This is a very exotic error.

Why is there any limit -- particularly one as low as 63 characters -- to the connect string?
To Top