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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:28:51+00:00 2026-05-22T18:28:51+00:00

I know you can pass a key or a range to return records in

  • 0

I know you can pass a key or a range to return records in CouchDB, but I want to do something like this. Find X records that are X values.

So for example, in regular SQL, lets say I wanted to return records with ids that are 5, 7, 29, 102. I would do something like this:

SELECT * FROM sometable WHERE id = 5 OR id = 7 or id = 29 or id = 102

Is it possible to do this in CouchDB, where I toss all the values I want to find in the key array, and then CouchDB searches for all of those records that could exist in the “key 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-22T18:28:52+00:00Added an answer on May 22, 2026 at 6:28 pm

    You can do a POST as documented on CouchDB wiki. You pass the list of keys in the body of the request.

    {"keys": ["key1", "key2", ...]}
    

    The downside is that a POST request is not cached by the browser.

    Alternatively, you can obtain the same response using a GET with the keys parameter. For example, you can query the view _all_docs with:

    /DB/_all_docs?keys=["ID1","ID2"]&include_docs=true
    

    which, properly URL encoded, becomes:

    /DB/_all_docs?keys=%5B%22ID1%22,%22ID2%22%5D&include_docs=true
    

    this should give better cacheability, but keep in mind that _all_docs changes at each doc update. Sometimes, you can workaround this by defining your own view with only the needed documents.

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

Sidebar

Related Questions

I know that I can pass a string as the second parameter to the
I know from here that I can pass an ignore option in the jQuery.validate
In Visual Studio Debug part, we can pass arguments. I want to know how
This is something I know can be done somehow , because I've done it
I have a query that I know can be done using a subselect, but
I would like to know how can I pass data from controller to view
I know you can pass arguments through the RunWorkerAsync function call when you first
You can know if the event stack is empty calling the gtk.events_pending() method, but
I know I can do most of this by hacking Trac and using Git
I know you can look at the row.count or tables.count, but are there other

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.