1

I am using Firebase realtime DB in my app,I could not use multiple order by in my query.If i am not use that one,looping the data again and again.It leads my app run slow.So please help me how to do that.Otherwise how to get multiple items in single Query

DatabaseReference reference = FirebaseDatabase.getInstance().getReference();

Query query = reference.child("issue").orderByChild("id").equalTo(0,1,3);

...Like,is it possible????

AL.
  • 36,815
  • 10
  • 142
  • 281
MariP
  • 35
  • 1
  • 8
  • I think this is not possible. plz check https://firebase.google.com/docs/reference/js/firebase.database.Query – Sree Jun 01 '17 at 05:26
  • Ok,Then is there anyway how to use multiple order by in query,Please give some ideas – MariP Jun 01 '17 at 05:31
  • I think you need to create multiple queries and executed inside a loop. – Sree Jun 01 '17 at 05:32
  • Definitely it will slow down my application,how to resolve this problem – MariP Jun 01 '17 at 05:34
  • There will be a delay but no worries firebase cache control will handle this. – Sree Jun 01 '17 at 05:35
  • Thank you for your help.May i know details clearly about Firebase cache. – MariP Jun 01 '17 at 05:41
  • The Firebase Database can only order/filter on a single property. Sometimes it may be possible to combine the values you want to filter on in a single property. See my answer here for an example: http://stackoverflow.com/questions/26700924/query-based-on-multiple-where-clauses-in-firebase – Frank van Puffelen Jun 01 '17 at 09:04
  • Yes Frank,My exact question is...id->keyword:"bag,shoe,bata"...i stored...I need a query how to filter that keyword that contains bag... – MariP Jun 01 '17 at 09:28
  • productList->id1->keyword:"bag,bang,hook", ->product_id:"1", ->product_name:"My Product" ->id2->keyword:"hook", ->product_id:"2", ->product_name:"My Product1"....Please help me – MariP Jun 01 '17 at 09:32

0 Answers0