Firebase establecido por prioridad

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()

preguntado el 28 de mayo de 14 a las 14:05

You can't reverse the results yet. See este hilo para más detalles -

Hey Nick! Is there some reason you can't just put a - in front of the value to reverse them? E.g. 5 se convierte en -5, et al. You can also use endAt().limit(x) to grab the last x records (i.e. the highest prorities). Do either of those help? -

@Kato - I tried that and at the time it didn't work. May give it another go :-) -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.