We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我在配置文件中配置了默认使用的mongo数据库A,但是同时,因业务需要,我想在业务逻辑中动态去连接其他mongo数据库B,请问现在可以实现这个需求吗? 数据库A和数据库B中存在同名的表格,比如都有User表,在获取数据时是否会有冲突?
我做过的尝试: 我在代码中做了如下尝试,可以连接数据库B成功,但是不知道怎么获取数据 const db = mongoose.createConnection(urlB, options) db.on('connected', async () => { db.model.User.fineOne() // 这种方式不行 })
The text was updated successfully, but these errors were encountered:
不是可以配置多个clients么?
Sorry, something went wrong.
No branches or pull requests
请详细告知你的新点子(Nice Ideas):
我在配置文件中配置了默认使用的mongo数据库A,但是同时,因业务需要,我想在业务逻辑中动态去连接其他mongo数据库B,请问现在可以实现这个需求吗?
数据库A和数据库B中存在同名的表格,比如都有User表,在获取数据时是否会有冲突?
我做过的尝试:
我在代码中做了如下尝试,可以连接数据库B成功,但是不知道怎么获取数据
const db = mongoose.createConnection(urlB, options)
db.on('connected', async () => {
db.model.User.fineOne() // 这种方式不行
})
The text was updated successfully, but these errors were encountered: