-
Type: New Feature
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
None
-
Environment:Server OS = CentOS 6.5
Client OS = CentOS 6.5
mongo C driver version = 1.1.7
mongo DB version = 2.6.5
Our application uses the mongo C driver to issue all the configuration commands to the server.
Our application uses 32 threads to interface to the mongo servers.
We use SSL and authorization.
We are in the Eastern Time Zone of USA (New Jersey)Server OS = CentOS 6.5 Client OS = CentOS 6.5 mongo C driver version = 1.1.7 mongo DB version = 2.6.5 Our application uses the mongo C driver to issue all the configuration commands to the server. Our application uses 32 threads to interface to the mongo servers. We use SSL and authorization. We are in the Eastern Time Zone of USA (New Jersey)
I would like to code our application to trap on this bson_error_t returned by mongoc_collection_insert():
domain: 11
code: 11000
message: insertDocument :: caused by :: 11000 E11000 duplicate key error index: DSC_service1_DBNAME.TABLENAME.$_id_ dup key: { : "SDF" }
However I don't want to put "magic numbers" in our code, like this:
if (error.code == 11000)
I would like to code it like this:
if (error.code == SOME_ENUMERATION_FOR_DUPLICATE_KEY)
Where do I find the enumeration?
Thanks,
Barry
- depends on
-
CDRIVER-644 bson_error_t's "code" is often wrong
- Closed
- is depended on by
-
PHPLIB-225 Ensure that users can distinguish duplicate key write errors
- Closed