How do I manage MongoDB connections in a Node.js web application?

前端 未结 11 2332
旧巷少年郎
旧巷少年郎 2020-11-22 02:42

I\'m using the node-mongodb-native driver with MongoDB to write a website.

I have some questions about how to manage connections:

  1. Is it enough using

11条回答
  •  忘了有多久
    2020-11-22 03:14

    I have been using generic-pool with redis connections in my app - I highly recommend it. Its generic and I definitely know it works with mysql so I don't think you'll have any problems with it and mongo

    https://github.com/coopernurse/node-pool

提交回复
热议问题