【发布时间】:2017-02-15 08:42:40
【问题描述】:
我已将 mongoid gem 从 mongoid-4 on rails 4 应用程序更新为 5。我在应用重启时面临以下警告
W, [2017-02-15T13:59:49.356541 #14483] WARN -- : MONGODB Unsupported client option 'max_retries'. It will be ignored.
W, [2017-02-15T13:59:49.356739 #14483] WARN -- : MONGODB
Unsupported client option 'retry_interval'. It will be ignored.
W, [2017-02-15T13:59:49.356877 #14483] WARN -- : MONGODB Unsupported client option 'username'. It will be ignored.
如何更新 Mongoid Yml 以消除警告?
这也是当前的 YML 文件
staging:
clients:
default:
database: chillr_api
hosts:
- localhost:27017
options:
read:
mode: :nearest
# In the test environment we lower the retries and retry interval to
# low amounts for fast failures.
max_retries: 1
retry_interval: 0
username: 'username'
password: 'username'
【问题讨论】:
-
只删除选项?
-
不,我想知道如何在 Mongoid 5 中启用它
-
是的。我想。 max_retries: 1 和 retry_interval 是 Moped 配置,在 mongoid 5 中被移除
标签: ruby-on-rails ruby mongodb mongoid4 mongoid5