mongo-typescript-example
mongo-typescript-example copied to clipboard
连接错误
非常感谢你的帮助,我不是很会英语,有一个问题,我创建一个连接,在某个函数里面保存该数据,在另外一个函数里面查找这个数据,他们公用一个数据库,需要使用连接,但是在不同函数里面,创建连接,会有 这个错误
非常感谢你的帮助,我不是很会英语,有一个问题,我创建一个连接,在某个函数里面保存该数据,在另外一个函数里面查找这个数据,他们公用一个数据库,需要使用连接,但是在不同函数里面,创建连接,会有 这个错误
Thank you very much for your help. I am not very good at English. There is a problem. I create a connection, save the data in one function, and find the data in another function. They share a database and need to use the connection. But in different functions, creating a connection will have
This mistake
Cannot create a new connection named "db1", because connection with such name already exist and it now has an active connection session. I also used getConnection (name: string) or connectionManager. get (name: string) to get the required connections.