I am using mongodbc# driver which includes legacy driver. And using InsertOne() method insert records. But it is void, how do I know if there is error in insertion and what type of exception is thrown.
2 Answers
It will raise an exception if an error occurs. http://mongodb.github.io/mongo-csharp-driver/2.2/reference/driver/error_handling/#write-exceptions