There is a way to add server timestamps in firebase-admin python sdk? I try:
firestore.SERVER_TIMESTAMP
firestore.constants.SERVER_TIMESTAMP
firestore.SERVER_TIMESTAMP
worked for me. Here's the full example:
import firebase_admin
from firebase_admin import firestore
# I have GOOGLE_APPLICATION_CREDENTIALS configured.
firebase_admin.initialize_app()
client = firestore.client()
result = client.collection('test').document('foo').set({
'mytime':firestore.SERVER_TIMESTAMP
})
print(result)
This printed out:
update_time {
seconds: 1523491166
nanos: 932097000
}
And the value was stored in database as expected.