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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:13:35+00:00 2026-05-27T04:13:35+00:00

I am building a simple couchapp CRUD application. When I fetch a view, I

  • 0

I am building a simple couchapp CRUD application. When I fetch a view, I get a 304 response from CouchDB. In futon, the same view returns documents.
Below is the snippet where I am querying the view and appending the returned items to a div. In the javascript console, I get an error saying “Can not read property _id of null”

db = $.couch.db("itemly");
function updateItems(){
    $("#all").empty();
    db.view("itemly/byitemname",{ success: function(data){
     for (i in data.rows){
         $("#all").append('<div id="' + data.rows[i].value._id + '" class ="itemrow"><span>'+data.rows[i].value.name + "</span><span>"+data.rows[i].value.price + "</span><span>"+data.rows[i].value.category + "</span><span>"+'<a href="#" id="'+ data.rows[i].value._id + '" class = "edit"> Edit Item </a>' +"</span><span>"+'<a href="#" id="'+ data.rows[i].value._id + '" class = "remove"> Remove Item </a>' +"</span></div>");
     }
    }
});
}

}
  • 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-27T04:13:36+00:00Added an answer on May 27, 2026 at 4:13 am

    I finally figured out the issue. I used

    couchapp generate view byitemname
    

    to generate my view. It created a “map.js” as well as a “Reduce.js” file. I edited the map.js file according my requirement but the empty reduce.js file resulted in couchdb returning null when I fetched the view.

    Note that in futon, the view “byitemname” worked properly because in futon, you have to explicitly run the reduce.js but while fetching from an app this happens automatically.

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

Sidebar

Related Questions

Building simple code (example is below) returns error on eclipse, while g++ from commandline
I'm building a simple Todo List application where I want to be able to
I'm building a simple ASP.NET web application in VS 2008 with a SQL 2005
I'm building a simple web based forum application. I want to allow users to
I'm building simple dictionary application using WPF. I'm using MVVM pattern, databinding and FlowDocument
I'm building simple application on as3. Kind of starship game. What I want to
I am building a simple Calculator application. I'm also learning how to apply the
I am building a simple java/android application, and am trying to change the value
I'm building a simple solid modeling application. Users need to be able to manipulate
I am building a simple e-mail application to send emails to a list of

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.