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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:17:03+00:00 2026-06-15T04:17:03+00:00

I prepare to use CouchDB to my project. but cannot find a way to

  • 0

I prepare to use CouchDB to my project. but cannot find a way to implement a view like an SQL SELECT * FROM Employees WHERE LastName NOT IN (SELECT LastName FROM Managers). In other words, I want to get a set from view A but not in view B. Question: how to implement not-in condition in CouchDB?

  • 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-15T04:17:04+00:00Added an answer on June 15, 2026 at 4:17 am

    Keeping employees and managers lists different sets of documents is using relational structure where you DB is not relational. If, for some reason, you are forced to do that, you need some way to distinguish the scheme of the doc (from which table it is). Lets say you are doing it with field scheme:

    { _id: "EMPL_ID", scheme: "employee", ... }
    { _id: "MNGR_ID", scheme: "manager", employee: "EMPL_ID", ... }
    

    Then you can use map:

    function (doc) {
        if (!doc.scheme) return;
        if (doc.scheme != "manager") emit(doc.last_name, doc);
    }
    

    If, for some strange reason, you cannot do that, and you only have the reference to employee doc in manager doc, you can emit both documents:

    function (doc) {
        if (some_test_for_being_employee_scheme(doc))
            emit([doc._id, 1], doc);
        if (doc.emp_id)
            emit([doc.emp_id, 0], null);
    }
    

    You will get the list of employees with keys ["employee_id", 1], and each manager is preceded with the row labeled as manager (key [..., 0]). This will require some space, but with list function you can filter out managers easily and the client will receive from DB only the non-managers.

    Keep in mind, that it is only the workaround for not making proper DB design.

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

Sidebar

Related Questions

I use this method to access my MySQL database: $STH = $DBH->prepare(SELECT email FROM
I am trying to prepare my activity's how to use windows but I am
Is there a way to use Command.Prepare, and Command.ExecuteNonQuery in VBA? The section entitled
I would like to prepare an old-school argument vector (argv) to use within the
I'm a bit confused when to take the long way around and use prepare
I use rake to prepare files for development. But I can't compile my sass
I'm trying to use call_user_func_array and mysqli_stmt::bind_param like so: # A. prepare an insert
I want to use a single database connection with multiple queries but use prepare
Edit: Prepare my objects for the use within a HashMap. after reading a bit
I want to use ADO.NET Prepare command will increase performance if query is repeatevely

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.