2

I'm trying to figure out if we should be explicitly calling connection.close when using the standard mongoose operations. Under the hood is mongoose & the native driver giving the connection back to the pool when no operations are used on it, or is it calling close behind the scenes, or just letting it timeout before giving it back?

I'm researching as well and will post and answer if I find it.

4

1 回答 1

4

如此处所述,您应该在应用程序启动时打开一次猫鼬连接,并且在应用程序关闭之前不要关闭它。对于大多数应用程序,无需显式释放操作之间的连接。

于 2013-04-03T16:10:36.530 回答