Wednesday, 12 April 2017

Globally set mongodb max time on query

I'm using the nodejs driver.

I'm setting a maxtime on my db queries like this:

  col.find(
    filter
  ).maxTimeMS(500).toArray (err, data) ->

I'm doing it on every single query. Is there a way to set a max time globally so that no query takes more than 500 ms?



via Harry

No comments:

Post a Comment