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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:10:55+00:00 2026-06-03T19:10:55+00:00

Basic problem I have some large, but logically organised documents – and would like

  • 0

Basic problem

I have some large, but logically organised documents – and would like to perform updates on just a sub-section of an individual document.

Example

Given this simple document:

_id: 123456,
_rev: 3242342,
name: 'Stephen',
type: 'Person',
hobbies: [ 'sky-diving' ]

In my application I might have an addHobbies method, that would use a view that just retrieves:

_id: 123456,
_rev: 3242342,
hobbies: [ 'sky-diving' ]

So that it can then add an additional hobby to the hobbies array, and then PUT just this sub-set of data back to the document.

Question

As I understand it, CouchDB [1.2] does not allow partial updates like this, and so I believe it would be necessary to grab the whole document during the save operation, merge my changes, then PUT the whole document back on every single save.

  • Is there another way of doing this (am I wrong about CouchDB’s capabilities)?
  • Are there any libraries (I’m using express on node.js) to handle this kind of operation?
  • 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-03T19:10:56+00:00Added an answer on June 3, 2026 at 7:10 pm

    You are correct. That is, in fact, what document database means: check-outs and check-ins.

    You can create (or use) shim code to simulate what you want, letting you focus on the important parts. On the server side, you can use update functions.

    There are many solutions on the client side.

    cradle.js will give you fake partials updates with the merge method.

    If you only want to update one or more attributes, and leave the others untouched, you can use the merge() method:

    db.merge('luke', {jedi: true}, function (err, res) {
        // Luke is now a jedi,
        // but remains on the dark side of the force.
    });
    

    https://github.com/cloudhead/cradle/

    Related, and also for Node.js is Transaction for performing arbitrary atomic transactions on CouchDB documents.

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

Sidebar

Related Questions

I have a pretty basic problem but I can't seem to figure it out...
I think I have some basic understanding problem so maybe someone's able to help
I have such a basic problem in Delphi,I can't solve it. My Code: Note:DataR
So I have a rather basic javascript problem which I have been slamming my
I think i have a basic problem in understanding the dojo toolkit. Well I
I have a very basic texture map problem in GL on iPhone, and I'm
I have a problem with AvalancheImagineBundle for Symfony 2 I followed the basic instructions
I think I have a synchronization problem...It may be too basic..Please help.. I have
I have a problem with operators. Generally I know basics of using operators. But
I have an idea for a large web application, which in my mind would

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.