Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Controlling Connection timeouts? #77

Closed
davidsinclair opened this issue Sep 17, 2014 · 2 comments
Closed

Controlling Connection timeouts? #77

davidsinclair opened this issue Sep 17, 2014 · 2 comments

Comments

@davidsinclair
Copy link

Hi,

I am new to Monk but have found it very useful in writing a rest web service backed by mongodb. However, in writing some unit tests for my REST web service I realised that I do not have a way to control connections timeouts.

How would I go about specifying that requests should timeout after say 2 seconds?

Thanks,

David

@hiddentao
Copy link

Don't see any way of doing this in the codebase.

@mathieudutour
Copy link
Collaborator

you can pass an options object as the second argument of the connection (after the url string). https://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#mongoclient-connect-options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants