Details
Description
The application works fine for a long period of time then suddenly throws an exception (attached), and the app eventually crashes.
Before crash the exception shows that a document in database has a field (auto property in C#) of an incorrect type. For example recently it was a
DateTime FirstEventTime
with a value of 0. And the exception was "Cannon cast from double to DateTime". That is, the database becomes inconsistent (no query can be performed on that collection from C#) until an update of that property or a manual document removal.
The application is multithreaded, without any JavaScript for any DB operation, only the Insert(), Update(). FindOneById() and AsQueryable() methods provided by MongoCollection<T>.
Attached are a couple of stacktraces (Payment.Nr is a string autoproperty).