Alexey Sirenko
Alexey Sirenko

Reputation: 462

MongoDB updateMany timeout

Is it possible/necessary to set execution timeout to DBQuery.Option.noTimeout for update queries? I have a large dataset and a query that may take more than 10 hours to modify all the records. Documentation says that such timeout could only be specified for a cursor via cursor.addOption(), but I was unable to find a way to specify a timeout for write queries. Does it mean that it is infinite by default? Is there another way to specify a timeout for write operators? Or there is no need to do it at all? Thank you

Upvotes: 0

Views: 1689

Answers (1)

Marco
Marco

Reputation: 761

You can edit connection options:

  • connectTimeoutMS
  • socketTimeoutMS

By default they are both set to never timeout

Upvotes: 2

Related Questions