I want to insert a document using a REST call to Firestore createDocument method. One of the fields is a timestamp field that should be set on the server. With Android SDK it's as simple as annotating a Date
field with @ServerTimestamp
and keeping it null — now how do I do it in REST?
{
"fields": {
"timezoneId": {
"stringValue": "Europe/London"
},
"city": {
"stringValue": "London"
},
"timestamp": {
"timestampValue": "???"
}
}
}
I tried using null
, 0
, empty string, timestamp
— everything fails with an error requiring the standard RFC3339 format (e.g. 2018-01-31T13:50:30.325631Z
). Is there any placeholder value I can use, or any way to obtain that timestamp?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…