Linked Server in SSMS 2014 - Shared Memory Provider, error: 0 - The pipe has been ended
I am not a mongodb developer, but I am not surprised that you had hit the 30 second problem. 

See Do you want a timeout? (mLab Blog) for hints. 


  The default driver connection timeout value ranges anywhere from 1 second (e.g. the Node.JS driver in some cases) to 30 seconds (e.g  the Ruby driver), so you really need to think about what the optimal setting is for your use case.


The socket timeout ideally needs to be set to 0 which means 'forever'.


  Disclaimer
  The original answer was posted as a comment by @RLF