[CDRIVER-167] Clarification on mongo_connect example in tutorial Created: 15/Aug/12 Updated: 11/Sep/19 Resolved: 17/Aug/12 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | 0.6 |
| Fix Version/s: | 0.7 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Stennie Steneker (Inactive) | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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:
Although conn->err is 0 (MONGO_CONN_SUCCESS) when connected, it doesn't seem possible to get both an error and be successfully connected? |
| Comments |
| Comment by Gary Murakami [ 17/Aug/12 ] |
|
MONGO_CONN_SUCCESS is defined as mongo_error_t value 0, but it is never used in the code base - tutorial fixed |
| Comment by auto [ 17/Aug/12 ] |
|
Author: {u'date': u'2012-08-16T19:16:25-07:00', u'email': u'gary.murakami@10gen.com', u'name': u'Gary Murakami'}Message: |
| Comment by Gary Murakami [ 17/Aug/12 ] |
|
Stephen - you are correct. While MONGO_CONN_SUCCESS is defined as mongo_error_t value 0, it is never used in the code base. I'll fix the tutorial. Thanks for pointing it out. |