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 8501667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:16:25+00:00 2026-06-11T01:16:25+00:00

I have been attempting to retrieve couchdb documents with a date key, of the

  • 0

I have been attempting to retrieve couchdb documents with a date key, of the format: yyyy mm dd.

I’d like to be able to retrieve a range of dates, using views in couchdb-python. I can get it to work, using curl. E.g.:

curl -X GET mylocation:5984/small/_design/Common/_view/date?startkey='"2012%2006%2004"'\&endkey='"2012%2006%2006"'

However, using the view method in Python, e.g.

a=ui.db.view(docname, startkey='"2012%2006%2004"', endkey='"2012%2006%2006"')
a.rows

produces nothing. I’ve tried:

  1. Using the startkey alone –works

  2. Endkey alone — doesn’t work.

  3. Changed the keys to a composite key of the form: “yy”,”mm”,”dd”

then tried retrieving them as follows:

a=ui.db.view(docname, startkey='\["12","06","04"\]', endkey='\["12","06","06"\]')
a.rows

Again, startkey by itself works, no use of endkey works. This also works normally in curl, e.g.:

curl -X GET mylocation:5984/small/_design/Common/_view/date?startkey='\["12","06","04"\]'&endkey='\["12","06","06"\]'

I then changed the keys to be integers rather than strings–again anything with startkey works, anything with endkey doesn’t work.

I finally changed the key to just integers 1–>10, and still can’t get endkey to do anything.

I’m using couchdb-python version 0.8. I’m debugging this inside of eric4 (Could THAT be the problem?)

  • 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-06-11T01:16:27+00:00Added an answer on June 11, 2026 at 1:16 am

    You don’t need to encode startkey/endkey query parameters explicitly to JSON in view call. CouchDB requires them to have valid JSON value by default. E.g. if your view returns composite key in form [“yy”, “mm”, “dd”], then your view request will be next


    a = ui.db.view(docname, startkey=["12","06","04"], endkey=["12","06","06"])

    Note, that startkey and endkey has list type values – same as your view function key.

    About curl request: it is not equivalent to your db.view() request: single quotes acts as shell string escaping, but they wouldn’t pass with request. So actual request to CouchDB from curl is


    mylocation:5984/small/_design/Common/_view/date?startkey=["12","06","04"]&endkey=["12","06","06"]

    Unless you’ll have invalid_json error response, because JSON strings should be double quoted.

    Anyway, you may look into CouchDB logs (info level is enough for your case) to compare actual requests to CouchDB from your Python program and from curl – they would be different for your situation.

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

Sidebar

Related Questions

I have been able to retrieve values into my form.The values are inserted into
I have been attempting to split a div into two columns using CSS, but
Hi so i am using msVS++2010 and have been attempting to set up SFML
I am attempting to retrieve the most recent date that my users have logged
I have been attempting to use ASP.NET MVC remote validation for username login access
I have been attempting to learn Grails, however I am running into the following
I have been attempting to write a VBA Script that can parse out other
I have been attempting to debug my program, but it always seems to get
I have been attempting to have a object that I can use across multiple
I have been attempting to get log4net logging in my asp.net web application with

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.