0

I want to push the same key for multiple nodes, this key I want to set it's priority to date so when getting the data get recent first,

When I used the key for only one node I do like that

Reference.child("ch").push().setvalue(object,0-date.getTime);

then when retrieve data get recent

but now when I do this

string key=Reference.push().getkey();

then

Reference.child("ch").child(key).setvalue(object,0-date.getTime);

when retrieving with priority order not get the recent any help, please!!

fady zarif
  • 79
  • 1
  • 11
  • I recommend not using priorities anymore. While they continue to work, they have no benefits and lead to less maintainable code. For more on that, see https://stackoverflow.com/questions/31577915/what-does-priority-mean-in-firebase – Frank van Puffelen Sep 25 '17 at 12:38
  • Aside from that: since your problem is in retrieving the data, please share the code that reads and processes the data (typically just some `console.log` might be enough to reproduce the problem). – Frank van Puffelen Sep 25 '17 at 12:39
  • my problem is I want to get recent first so when did the second scenario by getting the key first then set value to this key with priority, when retrieving the data with orderbyPriority not getting recent, I think the second scenario does not push with priority !! – fady zarif Sep 25 '17 at 12:46

0 Answers0