ddhhz
ddhhz

Reputation: 421

Use TIMESTAMP in Firebase Security Rules

Is there a way to use Firebase.ServerValue.TIMESTAMP or new Date().getTime() in firebase security rules to check against a timestamp value?

Upvotes: 0

Views: 1249

Answers (1)

Michael Lehenbauer
Michael Lehenbauer

Reputation: 16319

You're looking for the 'now' variable. E.g.:

// Ensure data being written is in the future.
".write": "newData.val() >= now"

Upvotes: 5

Related Questions