Is there a way to find the query that was run against the database in spring data mongodb?
I know this is possible in case of JPA. So was just wondering if there was something similar in Spring data MongoDB?
Is there a way to find the query that was run against the database in spring data mongodb?
I know this is possible in case of JPA. So was just wondering if there was something similar in Spring data MongoDB?
The easiest way is to set the log level to DEBUG for org.springframework.data.mongodb.
logging:
level:
org.springframework.data.mongodb.core.MongoTemplate: DEBUG
To clarify Oliver's answer add that to the application.yml file or properties file.