-
Type: Task
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: 9.0.0
-
Component/s: None
-
Ruby Drivers
-
Not Needed
-
When using a time series collections we use the following `store_in` option.
class MyModel include Mongoid::Document include Mongoid::ShortTimestamps field :aid, as: :account_id belongs_to :account, foreign_key: :aid, inverse_of: :usage_records field :c, as: :count, type: Integer field :m, as: :metadata, type: Hash store_in collection_options: { time_series: { timeField: 'ca', metaField: 'm', granularity: 'hours' } } end
After upgrading to Mongoid 9 we get the following error.
Mongoid::Errors::InvalidPersistenceOption · Translation missing: en.mongoid.errors.messages.message_title: Translation missing: en.mongoid.errors.messages.invalid_persistence_option.message Translation missing: en.mongoid.errors.messages.summary_title: Translation missing: en.mongoid.errors.messages.invalid_persistence_option.summary Translation missing: en.mongoid.errors.messages.resolution_title: Translation missing: en.mongoid.errors.messages.invalid_persistence_option.resolution
If we enable the following, the error goes away.
Mongoid.legacy_persistence_context_behavior = true