2014년 12월 16일 화요일

[mongodb-csharp] C# Driver: trying to find BulkWriteResult.writeErrors

According to http://docs.mongodb.org/manual/reference/method/BulkWriteResult/#BulkWriteResult there is a property BulkWriteResult.writeErrors.

I am using C# driver version 1.9.2 and can not find any property for WriteErrors.

Am I missing something?



The documentation you linked to is for the MongoDB Shell.

It works a little differently in the C# driver.

A BulkWriteResult does not have a WriteErrors property because when a bulk write succeeds and returns a BulkWriteResult there are no errors.


If something goes wrong during a bulk write, a MongoBulkWriteException will be thrown, and the exception has a property called WriteErrors that describes the write errors.



Also responded to this question in the mongodb-user group. Probably better to continue the discussion there if there are any follow up questions.


댓글 없음:

댓글 쓰기