I'm creating a MongoDB connector for an application, and was wondering if it's possible to check if a MongoDB server is up without knowing any databases.
Every example I have seen so far requires deprecated methods or a database on the MongoDB server to be known.
An example of what I'm trying to do can be seen below;
How to check connection to mongodb
One way I thought about doing this was to use;
ListDatabaseNames()
catching any exceptions that relate to a connection failing. However, this seems like a bit of a 'dirty' solution, as I would also have to catch all exceptions relating to invalid permssions to run the command.
Perhaps, what I'm trying to do, doesn't make sense. If that's the case, please do say!