(Phonegap)Couchbase Lite query view Pagenation not working

Couchbase lite pagenation notworking.

Map Function As following:

                                        map: function (doc) {
                                            if (doc.type && doc.updatedOn&&doc.title) {
                                                emit(doc.updatedOn,
                                                    { 
                                                         id:doc._id,
                                                         type:doc.type,
                                                         title: doc.title,
                                                         description: doc.description,
                                                         featuredImage:doc.featuredImage,
                                                         rev: doc._rev,
                                                         totalLike:doc.totalLikes,
                                                         totalShares:doc.totalShares,
                                                         authorName:doc.author.firstname+" "+doc.author.lastName,
                                                         updatedOn:doc.updatedOn,
                                                         read:doc.read,
                                                         link:(doc.type=="link")?doc.link:false
                                                    }
                                                )
                                            }
                                        }.toString()

Pagenation try as .
stale=false&descending=true&startKey=%222016-10-31%2014:17:13%22&startkey_docid=taa-35&limit=10&skip=1_all_docs
but always returining same result.

Hi @shiva.050865

Could you provide the mobile platform (iOS/Android/Windows…) and Couchbase Lite version you are testing this with?

@jamiltz

Could you provide the mobile platform (iOS/Android/Windows…) and Couchbase Lite version you are testing this with?

Thank you for quick response.

Am developing using ionic which support android/IOS but in both not working…
Version:1.3.0 (GitHub - couchbaselabs/Couchbase-Lite-PhoneGap-Plugin: Plugin to install Couchbase Lite in your PhoneGap app on iOS or Android)

Are you aware that with a descending query, startKey needs to be the maximum key in the range?

Also, the query string ends with &skip=1_all_docs, which doesn’t make any sense. Was that a copy-and-paste error?

Sorry while pasting by mistake 1_all_docs added… skip value is 1 and descending true… Yes from forum I got that point and using…

Note: But where Am checking from couchbase admin it is in reverse way startkey is minimum value even descending true.

Really? I’d be surprised if that were true, since it would break existing query code. The query API originates from CouchDB, and startkey has always been the maximum key in descending mode.

Do you mean key of last record or first record. ?

Yes lot of places I have found answer as you said but while I am testing from couchbase admin by creating development view it is working exactly opposite way. Does this behave based on version

Version info: Version: 4.1.0-5005 Community Edition (build-5005)

And once I complete all pagination it starting from first instead of showing “0” records.

@jens:

Thank you it is working well… small mistake done from my end… instead of startkey using startKey…