Is there a way to add time to a server timestamp without using cloud functions?
What I want is to update a timestamp from a panel, and have the user side check if th
You can't perform date math on server timestamps on the client. FieldValue
values are just tokens that are interpreted on the server. If you want to do date math using Google server time, you'll have to run that logic on Google servers.
If you absolutely need to do this on the client, you'll have to write the timestamp in one operation, then read the document back in a second operation, then write the modified date value back to the document in a third operation.
I'm a pretty old newb, and this is the first question I've read where I might be able to offer something. I really appreciate everything I've leaned here...
You can't alter timestamps but you can change the timestamps to UNIX time and manipulate them on the server side during doc creation.
ref.add({expires: firebase.firestore.Timestamp.now().toMillis() + 5000})
Then query based on expires from the front end. Probably not ideal, but when you only have the front end to work with...