Details
-
Task
-
Resolution: Done
-
Major - P3
-
0.6
-
None
-
None
Description
The API docs @ http://api.mongodb.org/c/current/tutorial.html#connecting include an example which suggests that you can get a mongo_connect() return value which is != MONGO_OK but still be able to check for MONGO_CONN_SUCCESS:
int status = mongo_connect( conn, "127.0.0.1", 27017 );
|
|
|
if( status != MONGO_OK ) {
|
switch ( conn->err ) {
|
case MONGO_CONN_SUCCESS: printf( "connection succeeded\n" ); break;
|
...
|
Although conn->err is 0 (MONGO_CONN_SUCCESS) when connected, it doesn't seem possible to get both an error and be successfully connected?