被用來更新到1.3.0 jongo從我們的MongoDB閱讀文檔時開始出現以下錯誤: com.fasterxml.jackson.core.JsonGenerationException: BsonSerializer can only be used with BsonGenerator
經過一些測試我發現問題發生在使用@JsonTypeInfo和MongoDB文檔包含 日期對象之前的類型屬
我使用mongoid 6.0.3 class C
include Mongoid::Document
field :h, type: Hash, default: {}
end
c = C.new
c.h = {"a" => "b"}
c.save!
puts c.h.class # gives Hash
saved_c = C.find(c.id)
put