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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:40:58+00:00 2026-05-18T00:40:58+00:00

I have two databases in CouchDB – DB1’s documents are user data – name,

  • 0

I have two databases in CouchDB – DB1’s documents are user data – name, email address, username, password but within one field that I store a list of the ID’s saved in DB2 where user projects are saved (containing a username field and some Textfields.

    Example DB1 Document (Users)

       {
   "_id": "bobsmith1000",
   "_rev": "83-1e00173cac0e736c9988d3addac403de",
   "first_name": "Bob",
   "password": "$2a$12$sdZUkkyDnDePQFNarTTgyuUZS6DL13JvBk/k9iUa5jh08gWAS5hpm",
   "second_name": "Smith",
   "urls": null,
   "email": "bob@smith.com",
   "projects": [
       "ee5ccf56da22121fd71d892dbe051746",
       "ee5ccf56da22121fd71d892dbe0526bb",
       "ee5ccf56da22121fd71d892dbe053433",
       "ee5ccf56da22121fd71d892dbe056c71",
       "ee5ccf56da22121fd71d892dbe0579c3",
       "ee5ccf56da22121fd71d892dbe05930d"
   ]
}

Example DB2 Document (Projects)

{
   "_id": "ee5ccf56da22121fd71d892dbe05930d",
   "_rev": "1-c923fbe9de82318980c7778c4c089321",
   "url": "http://harkmastering.s3.amazonaws.com/testprojects/testfolder.zip",
   "username": "bobsmith1000",
   "time": "2010-10-29 07:13:47.377085",
   "file_size": "5.2 MB"
}

I am trying to write a view in Python (using the Flask web framework and Python Couchdb library) that will check db1, grab all the project ids, and then go to db2 and in a batch way pull out the url, time, filesize for each document with matching ids so I can can place that data in a table.

I only began programming earlier this year and this involves techniques that I can only imagine. Can anyone help me find a solution?

Kind thanks

  • 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-18T00:40:59+00:00Added an answer on May 18, 2026 at 12:40 am

    Unless you have great reasons to split your docs in different dbs, that seems like is not the case according to your question, them you should keep them all on the same database and have some property on the docs to identify their type (like a “type: user” and “type: project”).

    That way you can get the desired result on a single couchdb view without too much trouble. In your view map function you will just need to emit keys like [“username”,0] and [“username”,”projectname”]. In Javascript that would be:

    function(doc) {
     if (doc.type == "user") {
      emit([doc._id,0],null);
     } else if(doc.type == "project") {
      emit([doc.username,doc._id],null);
     }
    }
    

    Them you can query that view and have an organized set of documents.

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

Sidebar

Related Questions

Lets say I have two types of documents stored in my CouchDB database. First
I have two databases at the same server 192.168.1.100 DB1 and DB2 When I'm
I have two databases, one is an MS Access file, the other is a
I am using SQL Server 2000 and I have two databases that both replicate
I have two SQL Server 2005 databases, one is for development and the other
When I have two mysql servers that have different jobs (holding different databases) but
I've got two PostgreSQL databases that have been created using the same sql file.
I have two databases, A, and B. On database A, I have a table
I have two databases for logging stuff, which I want to check for synchronization.
I have two databases, tvguide and episodes1. Both are InnoDB, and I use Phpmyadmin

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.