Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 442E810CE8 for ; Thu, 26 Sep 2013 18:17:16 +0000 (UTC) Received: (qmail 12977 invoked by uid 500); 26 Sep 2013 18:17:13 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 12944 invoked by uid 500); 26 Sep 2013 18:17:12 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 12930 invoked by uid 99); 26 Sep 2013 18:17:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Sep 2013 18:17:11 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.160.53] (HELO mail-pb0-f53.google.com) (209.85.160.53) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Sep 2013 18:17:06 +0000 Received: by mail-pb0-f53.google.com with SMTP id up15so1462384pbc.40 for ; Thu, 26 Sep 2013 11:16:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=IrE+3PZowdxVeN9plo/rtCQ3iNMTYEr2D+LYD/2jP8c=; b=FVpJKyezXCxK4vgoofUV/iPTsKS44Tm/naMcChuAPK9SPCZhqY0LWn43wNU29EHPlg KVtixBVVTKSXf2Fik8bFRUG6Dvwy+tiu91LuojqX2Aawghpn5a+hi9EZ+2ExnS3LqUD+ 84W4LjnH2xBn0T15mApuII11x5paDo+fervdPV+cK5DKaYXN/2ETnk4Bz5xTZ/HH6kvM lVMC6Tma2sQZy9YtR0SZEonjLACYbfK9OoeUNuh6F5HXmzGhaiGe2P5f9bN9bP7t/R/P 5oVQLIzQkvPoztXnZ/31R5iC80/TOHVQTrSBbVGDb7pnR3Ytvwi9b8WsHgSZVAQXL9ZT QPBA== X-Gm-Message-State: ALoCoQmf/H4+pmLGTkUjQNDnA+xOsn/Z8MDW6STFAcm3D/jcfBxa3HcUY0vGGsVTWjaecFYUpURz X-Received: by 10.66.27.143 with SMTP id t15mr6743868pag.171.1380219405842; Thu, 26 Sep 2013 11:16:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.70.95.66 with HTTP; Thu, 26 Sep 2013 11:16:05 -0700 (PDT) In-Reply-To: References: <1380218246.19728.YahooMailNeo@web121006.mail.ne1.yahoo.com> From: Mark Hahn Date: Thu, 26 Sep 2013 11:16:05 -0700 Message-ID: Subject: Re: Put method To: user Content-Type: multipart/alternative; boundary=bcaec52bea1965cf7404e74d5fb9 X-Virus-Checked: Checked by ClamAV on apache.org --bcaec52bea1965cf7404e74d5fb9 Content-Type: text/plain; charset=ISO-8859-1 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 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" 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 > > 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 > > > --bcaec52bea1965cf7404e74d5fb9--