LoginSignup
1
0

More than 1 year has passed since last update.

firestoreからget()したtimestampがnullになる件

Posted at

firestoreにcreatedAtやupdatedAtを追加した後に

doc(id).get().date()

でデータを取ろうとしたら 

[
   name: "test",
   createdAt: null,
   updatedAt: null,
]

とデータを吐き出してきた!
原因を探っていくとどうやらこいつが関係あるらしい
リンク先を参考に

doc(id).get().data({serverTimestamps: "estimate"})

とうつとうまく行った。
オプションや説明についてはこちらの分かりやすい記事を参照することをすすめる!

1
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
1
0