This is a pursue of knowledge.
I have this simple example webapi written in C# that inserts data into MongoDb in a transaction. So by calling a certain endpoint I do several inserts with a certain delay (for example 10 inserts, 1-by-1 with delay of 1 second between each insert). After last insert I commit the transaction. The same time I check with my other endpoint the total count of existing documents. There is no surprise here - if I request inserting 10 documents, my document count endpoint will return +10 only after the 10th document is inserted (and commit executes).
However - if I keep checking with Studio3T the total count of the documents - it increases gradually with each executed insert. If I cancel the request - the count in Studio3T returns to pre-request value. The screenshot below will hopefully explain it better:
So I have at least 3 questions that I could not find an answer to:
- What setting in Studio3T allows for these dirty reads?
- What do I need to set in my client to actually allow for dirty reads?
- What do I need to set in my session/transaction options to block Studio3T (or any other client) from preforming these dirty reads?
Last thing that is also curious - if I stop the app after several inserts but without commiting - Studio3T keeps seeing the inserted ones (at least counts them) for about a minute. I imagine there must be somekind of time to live for a session, but I did not find anything in the docs. I am sure I probably missed it, but if anyone knows the place where this behaviour is described, I would be grateful for pointing me in the right direction.