I am using Firestore as a database and now i want to store server timestamp when user register.
from the Firestore doc
Map up
You need to change this line of code:
private long timestamp;
with
private Map timestamp;
And here are the corresponding public setters
and getters
:
public void setTimestamp(Map timestamp) {
this.timestamp = timestamp;
}
public Map getTimestamp() {
return timestamp;
}
Remember, that you are setting the timestamp as Map
and when you are retrieving, you are retrieving it as a Long
.