doctrine/mongodb

socketTimeoutMS for map/reduce

Closed this issue · 2 comments

Is there a way do set socketTimeoutMS for a specific Map/Reduce in doctrine ? (i mean, without setting it in the global configuration, only for the specific query)

Doctrine\MongoDB\Collection::mapReduce() does handle a "socketTimeoutMS" option (parsed here) if provided alongside the other command options. The library extracts it from the remaining mapReduce command options and uses it as an argument to MongoDB::command(). If you grep Doctrine for "splitCommandAndClientOptions" you'll see other commands that do the same.

Note that if you're using mongo-php-adapter, this likely isn't supported, as ext-mongodb does not allow specifying a socket timeout on individual operations.

@jmikola thanks for this feedback