MongoRepository set timeout

269 views Asked by At

Hey Fellow developers,

I want to kill DB operations that last over a minute, some kind of timeout, not only for the backend code but to kill the DB process.

I'm using Atlas DB (mongo 4+) and the backend is written in Java, Spring, and I'm using MongoRepository and extending it with my own interface.

Any idea if this is possible? Need to kill the MongoDB task, some kind of timeout over the query.

1

There are 1 answers

0
bilak On

I'm looking currently for possible options and found out that it's possible to configure maxTime for the query. So it should be killed after the timeout defined.