couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hahn <m...@reevuit.com>
Subject Re: Put method
Date Thu, 26 Sep 2013 18:16:05 GMT
I use an update handler for every single update.  I put in a couchdb wiki
entry about how to update any part of a document.  An update looks like
{"/date/year" : "2013"} to just change the year in a nested property.  It
also creates missing property paths.  My code is much simpler using this.


On Thu, Sep 26, 2013 at 11:11 AM, Stanley Iriele <siriele2x3@gmail.com>wrote:

> @mark I have actually found that when my implicit schema is scattered
> across application code...like during a GET , change random stuff, PUT
> sequence it gets hairy and the code is more contrived... But when I use
> update handlers...I know everything in there is atomic and I can handle all
> of the weird cases there....and should it fail... I just have to
> reconstruct the http request.... Plus 1 call should be faster than a fetch
> and put.... But the actual put is slower because you're executing a
> function.... But I see what you mean...I just adore that guys because most
> other nosql datastores force you to deal with conflicts via referring data
> and what not... But now couch :-)
> On Sep 26, 2013 12:05 PM, "Mark Deibert" <mark.deibert@gmail.com> wrote:
>
> > @Stanley: You're definitely right, the update functions are powerful,
> but I
> > don't use them to keep logic out of my database. I like the database to
> be
> > as close to pure data as possible. I suppose I actually could use them
> just
> > for doc "patching". I should think about this... :-)
> >
> >
> > On Thu, Sep 26, 2013 at 1:57 PM, Ashraf Janan <ashrafjanan@yahoo.com>
> > wrote:
> >
> > > Hello sir!
> > > Thank you for answering and helping.
> > > Please sir , i will do the following:
> > >
> > > type:student
> > > name: Tom
> > > age:37
> > > _id:6789
> > >
> > > -----
> > > type: message
> > > sender: Pablo
> > > title: "important information"
> > > receiverid:6789
> > > text : "---------"
> > >
> > > in this case must i know the _id for a student to can send a message to
> > > him.
> > > and in the Url to get all the messages for that person i will do the
> > > following:
> > > http:// url/name of database/ _design/name of
> > > view/_view/student?key="6789"
> > >
> > > is that correct ? please
> > >
> > > Best regards
> > > Ashraf
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message