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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:53:28+00:00 2026-05-13T10:53:28+00:00

Not exactly sure what to call this, but in SQL I often find myself

  • 0

Not exactly sure what to call this, but in SQL I often find myself doing something like this while developing:

DELETE FROM people WHERE name == "John"

This is often used when I’ve just imported a bunch of data with a batch importer, and want to clear out a few results but not then entire data set. How do I go about doing this in CouchDB? I can easily make a map function

function(doc) {
   if (doc.Name == "John") 
       emit(doc._id, null);
}

And then delete the returned _ids…but that would require me to write some sort of front-end app to take these _ids and perform the DELETEs. Sometimes my queries are much more complex, and would require a few queries, followed by a delete, followed by another query and an update.

What’s the accepted method of doing this sort of map/delete and perhaps a map/update?

  • 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-13T10:53:29+00:00Added an answer on May 13, 2026 at 10:53 am

    The accepted method is pretty much just as you describe. Query the view and then delete the returned IDs. This isn’t as bad as it sounds though. A quick script in your choice of language with a CouchDB library and you are essentially just moving the logic of your SQL into a language with more power. Some might consider this benefit. YMMV

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

Sidebar

Related Questions

I'm not sure what exactly to call this, but I've been able to reproduce
Not exactly sure how to look this up, but I'm not finding the solution
Not exactly sure why this is happening, but upon click of a button I
I have seen a few examples of this but am not sure exactly how
I'm not exactly sure how to ask this question really, and I'm no where
Not sure exactly how to word this question ... so edits are welcomed! Anyway
Not sure exactly what I need to do to make this work, so my
I'm not sure exactly how to explain this, so I'll just start with an
I'm not sure exactly how much this falls under 'programming' opposed to 'program language
I've looked for an answer to this, but not finding exactly what I'm looking

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.