CatchDB Partial / Differential Recording

Main problem

I have several large, but logically organized documents - and I would like to perform updates only in a separate subsection of a separate document.

Example

Given this simple document:

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

In my application, I can have the addHobbies method that will use the view just received:

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

To then add an extra hobby to the array hobbies, and then PUTonly that subset of the data back into the document.

Question

, CouchDB [1.2] , , , , , PUT .

  • ( CouchDB)?
  • - ( express node.js) ?
+3
2

. , , : .

( ) , , , . .

.

cradle.js .

, merge():

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/

, Node.js CouchDB.

+4

, , JSON , Apache , , db.merge.

, , , Database.prototype.update( lib/cradle/document.js), , , .

, , CouchDB .

0

All Articles