4

I want to make a service that checks if a Mongo repository is up and running.

What would be the equivalent of SELECT 1 FROM DUAL from Oracle for a quick select?

I'm using Spring Data (org.springframework.data.mongodb.core.query.Query class). I would like not to use an existing collection in the database for this check, e.g, if possible, I would like not to count elements from a collection.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
resilva87
  • 3,325
  • 5
  • 32
  • 43
  • What do you mean by a `Mongo Repository is up and running`. Only Mongo Instances can be running bound to a repository. Do you wish to check if a connection can be established to a database? – BatScream Nov 25 '14 at 21:51
  • @BatScream yes, exactly that. – resilva87 Nov 26 '14 at 16:38
  • 1
    Does this answer your question? [how to check from a driver, if mongoDB server is running](https://stackoverflow.com/questions/6832517/how-to-check-from-a-driver-if-mongodb-server-is-running) – charlie_pl Apr 01 '21 at 13:01

0 Answers0