将Mongoid Gem更新为版本5问题的警告

时间:2017-02-15 08:42:41

标签: ruby-on-rails ruby mongodb mongoid4 mongoid5

我已经将mongoid gem更新为5轨道4应用程序中的mongoid-4。我在app restart

上面临以下警告
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'

1 个答案:

答案 0 :(得分:0)

Okey.Seems max_retries和retry_interval是Moped配置。由于Moped被带走了Mogoid 5这可以从配置中删除.Yml示例