I'm using this awesome library in a small microservice to connect to mongo and control some documents on it; but, the microservice deppends directly of this connection, so if the connection if dropped, instead of have a constant answer of http 500 or something other controlled error, I want to dettect if the connection was dropped, and throw an exception to destroy the ms.
I'm using this awesome library in a small microservice to connect to mongo and control some documents on it; but, the microservice deppends directly of this connection, so if the connection if dropped, instead of have a constant answer of http 500 or something other controlled error, I want to dettect if the connection was dropped, and throw an exception to destroy the ms.
So, how to I can check the connection state?
Thanks :)