My following piece of code writes a piece of data to firebase using priorities. This is all great and good. However I want to be able to arrange my list in reverse priority order? I understand that FB treats ordering as lowest first and higher further down the list... is there anyway of reversing this?
newMessageRef.setWithPriority({
'message': $scope.place.name + " has been edited",
'updated': $scope.place.updated,
'userid': Auth.signedInAs().id}, $scope.place.updated);
EDIT - I know I can add a custom "reverse" filter to my ng-repeat which does work but you can briefly see the "shuffle" taking place. Would be great to arrange the data at source in the order of most recently added/edited items at the top. Almost the opposite to doing an array style .push()
-
in front of the value to reverse them? E.g.5
becomes-5
, et al. You can also useendAt().limit(x)
to grab the lastx
records (i.e. the highest prorities). Do either of those help?