当前位置: 首页 > 工具软件 > Mongoid > 使用案例 >

mongoid 多库

蒋寒
2023-12-01
#coding:utf-8
class Phone
include Mongoid::Document
set_database :phone


end


config:
defaults: &defaults
host: 127.0.0.1
development:
<<: *defaults
database: person_data
databases:
spider:
database: person_data
host: 127.0.0.1
port: 27017
phone:
database: social_data
host: 127.0.0.1
port: 27017


production:
<<: *defaults
database: person_data
databases:
spider:
database: person_data
host: 127.0.0.1
port: 27017
phone:
database: social_data
host: 127.0.0.1
port: 27017
 类似资料: