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

The Archive Base Latest Questions

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

I am trying to create a webapp on a node/couchdb/windows stack but get terribly

  • 0

I am trying to create a webapp on a node/couchdb/windows stack but get terribly stung by what seems to be a lack of experience.

In the database, there is a view that returns all users with passwords. Based on the tutorial for a blog I have tried to access the view through my node code.

Whenever I investigate the structure of the users or users variable, I get an undefined object.

The call to getDatabase() has been tested elsewhere and works at least for creating new documents.

function GetUser(login) 
{
    var users = GetUsers();
    return users[login];
}

function GetUsers() {
    var db = getDatabase();
    var usersByEmail = [];
    db.view("accounts", "password_by_email")
        .then(function (resp) {
            resp.rows.forEach(function (x) { usersByEmail[x.key] = x.value});
        });
    //usersByEmail['test'] = 'test';
    return usersByEmail;

}

I am aware that both the use of non-hashed passwords as well as reading all users from the database is prohibitive in the final product – just in case anyone wanted to comment on that.

In case something is wrong with the way I access the view: I am using a design document called ‘_design/accounts’ with the view name ‘password_by_email’.

  • 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-11T05:01:27+00:00Added an answer on June 11, 2026 at 5:01 am

    Your call to db.view is asynchronous, so when you hit return usersByEmail the object hasn’t yet been populated. You simply can’t return values from async code; you need to have it make a callback that will execute the code that relies on the result.

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

Sidebar

Related Questions

Trying to create a new Dedicated Cache Role in Windows Azure but get the
I'm trying to create a very simple webapp with maven and eclipse, but I'm
I'm trying to create a ASP.NET MVC 2 webapp using the Northwind database following
Trying to create a black line in my view to separate text blocks but
I'm trying to finalize a signup process for my webapp, but am getting confused
I'm trying to create a Webapp which can read the user's Dropbox files. If
I'm trying to create a webapp with sencha. I've already tweaked a lot of
I am trying to create a Django webapp that utilizes the Twitter Streaming API
I am trying to create a single page webapp. There are two divs, right
I'm trying to create an webapp and searched around to find tutorials... I found

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.