Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 88809 invoked from network); 29 Dec 2008 13:15:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Dec 2008 13:15:23 -0000 Received: (qmail 89693 invoked by uid 500); 29 Dec 2008 13:15:17 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 89626 invoked by uid 500); 29 Dec 2008 13:15:17 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 89606 invoked by uid 99); 29 Dec 2008 13:15:16 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Dec 2008 05:15:16 -0800 X-ASF-Spam-Status: No, hits=3.8 required=10.0 tests=RCVD_NUMERIC_HELO,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [83.97.50.139] (HELO jan.prima.de) (83.97.50.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Dec 2008 13:15:09 +0000 Received: from 132.77.238.89.ptr.tiggersystems.info (softdnserr [::ffff:89.238.77.132]) (AUTH: LOGIN jan, TLS: TLSv1/SSLv3,128bits,AES128-SHA) by jan.prima.de with esmtp; Mon, 29 Dec 2008 13:14:45 +0000 Cc: dev@couchdb.apache.org Message-Id: From: Jan Lehnardt To: user@couchdb.apache.org In-Reply-To: <8A2A146E-F011-4502-9DD9-336300392CDC@apache.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: Changing rev to _rev in view results (Was: Re: newbie question #1) Date: Mon, 29 Dec 2008 14:14:44 +0100 References: <98979283-BB61-4D15-AF05-196979FA42BC@pobox.com> <49C5583B-254D-4D4D-A4F7-AD7306E758F1@gmail.com> <8A2A146E-F011-4502-9DD9-336300392CDC@apache.org> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On 29 Dec 2008, at 13:41, Damien Katz wrote: > I disagree we should change this back. I don't know if anyone > remembers, but this is how I implemented long ago in the first > versions of the post-XML CouchDB. The problem was there where other > reserved fields in documents that started with underscore, but in > other places the fields wouldn't have an underscore. Keep track of > which fieldname had underscores and where became confusing. The rule > was changed to be simpler to understand and deal with. If it's in > the root of a doc and it starts with underscore, it's reserved. You > don't see the reserved underscore fields anywhere else, only in > document top level. My issue with this is when learning about CouchDB, documents come first and the "special fields are prefixed with an underscore" rule is taken up naturally. Later with views and query parameters, this rule is broken. You could argue that when we teach documents, we should make the actual rule more explicit and that is certainly true, but we don't control the ways people pick up CouchDB. We control the API however and are able to reduce WTF-factors. > -Damien > > > On Dec 28, 2008, at 2:21 PM, Jan Lehnardt wrote: > >> >> On 28 Dec 2008, at 14:32, Antony Blakey wrote: >> >>> >>> On 28/12/2008, at 11:56 PM, Paul Davis wrote: >>> >>>> Why "id" and "rev" are used instead of "_id" and >>>> "_rev" I couldn't really tell you. I hate to say "historical >>>> reasons" >>>> but I'm guessing that when Damien designed the view output he just >>>> labeled then "id" and "rev" without the underscore because it's not >>>> needed to distinguish from the rest of the doc. >>> >>> Desirable to change that (and any other inconsistencies) before a >>> 1.0 >> >> This keeps coming up and I've been advocating this for a while now: >> >> +1 for changing view result rows `rev` to `_rev` to avoid confusion. >> >> CC'ing dev@c.a.o. >> >> Cheers >> Jan >> -- >> > >