0
0

More than 1 year has passed since last update.

google-cloud-firestore v2.7.0 はぶっ壊れている

Last updated at Posted at 2022-07-15

2.7.1が出たみたい

問題

firestore = Google::Cloud::Firestore.new
doc = firestore.doc("test/test")
doc.set(foo: 123)
doc.get.fields
# => {"foo"=>{:null_value=>:NULL_VALUE, :boolean_value=>false, :integer_value=>123, :double_value=>0.0, :timestamp_value=>nil, :string_value=>"", :bytes_value=>"", :reference_value=>"", :geo_point_value=>nil, :array_value=>nil, :map_value=>nil}}

documentのfieldの値が今までなら文字列のfieldは文字列で、タイムスタンプのfieldはTimeオブジェクトで、と素直に使える状態だったが、v2.7.0はどうもこの辺りがおかしい動作になっていて、上記のようにデカ目のHashが返ってくる、ので大体のアプリケーションでは値が取れずに死ぬ。

解決

gem "google-cloud-firestore", "2.6.6" 

2.6.6に固定する。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0