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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:26:55+00:00 2026-05-24T22:26:55+00:00

I have a document stored in couchdb which is like this – { _id:

  • 0

I have a document stored in couchdb which is like this –

{
 "_id": "0f8baf09c680abdc434607dc77000bad",
 "_rev": "2-c989a4c672d25b678aadfa4c37212404",
 "XI": "gl11subjects",
"XII": "gl12subjects"
}

when I retrieve the document using the code

@value = CouchRest.get("url/db/docid")

@value.each do |key, value| 

puts "Key: "+key+"value: "+value+

The above statement prints all the values in the json file, including _id and _rev.
How should I iterate through the @value to only get the key/value for XI and XII.

  • 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-24T22:26:56+00:00Added an answer on May 24, 2026 at 10:26 pm

    Here’s one way:

    @value.each do |key, value|
    puts "Key: #{key} Value: #{value}" if key.include?("XI")
    end
    

    Inversely, you could do the following:

    @value.each do |key, value|
    puts "Key: #{key} Value: #{value}" unless key.include?("_")
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this document stored in mongodb document: { _id:ObjectId(4eb7642ba899edcc31000001) hash:abcd123 value:some_text_here } I
I have stored images from the net like this Documents/imagecache/domain1/original/path/inURI/foo.png Documents/imagecache/domain2/original/path/inURI/bar.png Documents/imagecache/... Documents/imagecache/... Now
I have an object which represents some document stored in a relational database (O/R
I have the following vba-code in an MS-Access97-frontend which opens a word-document stored on
i have an xml document structured like this: <NewDataSet> <videos> <video> <name>name of video</name>
I have an versioned document store which I want to access through an dict
I have a document based on a xml structure that I have stored in
I have an HTML document stored in a file, with a UTF-8 encoding, and
I have some document stored as a large String. In the String I have
Problem: I have a document class which contains a list of objects. These objects

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.