像这样更改 db 对象中的 connection 参数: db.connection = mongoengine.connect('db2') 它没有改变任何东西. 执行 post = Post.objects.all() 仍然在原始数据库( db1 ) ...
確定! 回上一頁