FIRDatabase.database().reference().child("search").queryOrdered(byChild: "name").queryStarting(atValue: searchtv.text!).queryEnding(atValue: searchtv.text!+"\u{f8ff}").observe(.value ,with: { (snapshot) in .... var objectsperpage : UInt = 3
ref.queryOrderedByKey().queryLimited(toLast: objectsperpage).observe(.value, with: { (snapshot) in .....
self.lastkey = (Array(snapshot.children).first as AnyObject).key
ref.queryOrderedByKey().queryLimited(toLast: objectsperpage + 1).queryEnding(atValue: lastkey).observe(.value, with: { (snapshot) in....
Hi Mohammed,
You can add a child key into the queryEndingAtValue declaration as described here.
So for your second page, something like this:
.queryEnding(atValue: searchtv.text!+"\u{f8ff}", childKey: self.lastKey).observe(.value ,with: { (snapshot) in ....
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/85c58661-1315-4854-87e1-02d7987fab82%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.