Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6367113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:30:29+00:00 2026-05-25T00:30:29+00:00

I am trying to implement the previous page functionality for pagination, and I thought

  • 0

I am trying to implement the previous page functionality for pagination, and I thought that using the endkey parameter would return the previous page’s rows where the last row would equal the endkey. But is it even possible to do a query using ONLY the endkey parameter without startkey?

For example:


http://something.com:5984/db3/_design/app/_view/a_view?limit=5&endkey=["ABC","6L","201112"]&descending=false

When I run this query, the last row’s key is not equal to the endkey I specified. Instead, it seems like CouchDB just grabs the first 5 rows in the view and completely ignores the endkey parameter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:30:29+00:00Added an answer on May 25, 2026 at 12:30 am

    A query with endkey but not startkey will implicitly work like &startkey=null. That is, CouchDB will start from the very first key on the very first row and continue until it reaches the endkey.

    CouchDB always starts the response from its startkey, and stops the response from its limit or endkey value (whichever comes first).

    To fetch the last 5 rows, you need to scan backwards (descending) and then your startkey is right where you need it.

    ?limit=5&startkey=["ABC","6L","201112"]&descending=true
    

    The results will be in reversed (descending!) order. You can either reverse them in your client (it’s only five rows) or write a _list function in CouchDB to reverse them before sending a response.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement a slide down for table rows using the previous
I am trying to implement Pagination in JSF using Tomahawk. When the page is
trying to implement a dialog-box style behaviour using a separate div section with all
when trying to implement an Aspect, that is responsible for catching and logging a
im trying to implement a custom error page, what i want to be able
While trying to implement the second answer to a previous question , I am
I am trying to implement a game using the iPhone OS 4.0 (iOS4?) SDK.
I'm trying to implement an Undo/Redo stack in a C# application that I'm working
I'm trying to implement sieve of Eratosthenes in Clojure. One approach I would like
I am trying to implement paging across ajax calls. The page should not refresh

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.