I am using firebase.server.TIMESTAMP as a priority (as pre previous question Firebase - 'pushWithPriority' - and validation )
var ref = window.lastref.child("Offers").push();
ref.setWithPriority(spaceof.data, Firebase.ServerValue.TIMESTAMP,function (data) { $("body").prepend(data); }
This appears to work, setting the priority correctly.
However, I am adding a rule to ensure the timestamp is not set to a future time. Using this code:-
,"Offers" : {
".read" : "true"
,"$offerid" : {
".write" : "now >= newData.getPriority()"
This always fails. I have tried
".write": "true" // this works
and
".write" : "newData.getPriority()>=0" // this fails
and
".write" : "newData.getPriority()<0" // this fails
So I am starting to suspect the priority hasn't been resolved from the placeholder to a number yet?
Any suggestions??