On an insert into mongodb, can I set the writeconcern to something that will only ignore Duplicate Key errors? I want to completely ignore these errors, but still catch if something else went wrong. I'd especially like to know if I've lost my connection to the database or if mongod itself has crashed. (I'm on a research network, so these two things aren't always the most reliable.)
The writeconcern I see that seems to come close is UNACKNOWLEDGED, but I don't quiet understand what exactly it'll catch and what will be ignored.
My application is written in Java with mongo driver version 2.10.1 and using mongo version 2.4.6
I'm avoiding using the default writeconcern and simply catching the exception because I don't want the exception overhead. I expect the number of Duplicate Keys to be high. Is this a silly concern?