Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 78020 invoked from network); 2 Jan 2009 02:14:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2009 02:14:42 -0000 Received: (qmail 59629 invoked by uid 500); 2 Jan 2009 02:14:41 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 59584 invoked by uid 500); 2 Jan 2009 02:14:41 -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 59572 invoked by uid 99); 2 Jan 2009 02:14:41 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 Jan 2009 18:14:41 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of theflinnster@gmail.com designates 74.125.44.30 as permitted sender) Received: from [74.125.44.30] (HELO yx-out-2324.google.com) (74.125.44.30) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jan 2009 02:14:31 +0000 Received: by yx-out-2324.google.com with SMTP id 3so1822888yxj.5 for ; Thu, 01 Jan 2009 18:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=VcflUFfXFhhx31pLi+d/ViA1Edd/NK34OkViU1cRcGE=; b=jCaeheYt5IYzoL/KP1GKqOAVahxqnldUYiNJkKZmqKNrIeuTogzZ/Faw1YWvXb+p53 PJFb4an5vAIOtAZkfIMiggrOMp7nz6+z7U4vswAWjDB/f+xBsnSJL0DFp3S71N7xDzRo jfevIii8OY9G+S0UNF31ooPa0uRDr4beo+IDM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=Oj2YKZF6rGUrWIxMybICYJ4vN3q9SyoAuftDFGT5a2TweL6qEDUwWIUGOWrrP4LWZo PFmVs2MAgM4GQ1axOa6w4mq7jzQVlnvXzyA7Co34fIItQ4LMPFyMTEtRLHG6opwM79IY pvyxrGYtmTjidSaqe6w06l3D6ghtYYilS1Aac= Received: by 10.90.30.13 with SMTP id d13mr8235205agd.3.1230862450362; Thu, 01 Jan 2009 18:14:10 -0800 (PST) Received: from ?192.168.1.2? (c-71-235-225-250.hsd1.ct.comcast.net [71.235.225.250]) by mx.google.com with ESMTPS id 32sm36854193aga.39.2009.01.01.18.14.08 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 01 Jan 2009 18:14:09 -0800 (PST) Message-Id: From: Flinn Mueller To: user@couchdb.apache.org In-Reply-To: <7B58C5C8-388D-4CFC-B2B1-A473591E4CA2@pobox.com> 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: Thu, 1 Jan 2009 21:14:07 -0500 References: <98979283-BB61-4D15-AF05-196979FA42BC@pobox.com> <49C5583B-254D-4D4D-A4F7-AD7306E758F1@gmail.com> <8A2A146E-F011-4502-9DD9-336300392CDC@apache.org> <0743DF91-9015-43DD-9A0F-7E79D6DF4632@gmail.com> <0DE02009-32CB-4A88-8C39-7942E00BF8D6@apache.org> <2CC999E5-9D81-4981-B544-1977B9D16405@gmail.com> <154D8F25-87B3-49DC-9D80-6C68C946ECAF@gmail.com> <34FCDB16-6D06-4401-BCD8-0B053E2E935E@gmail.com> <48250456-2512-46BD-85E1-464457DBC995@pobox.com> <48F376DC-9521-4A0C-9652-C4AB24769E7F@gmail.com> <3164E1E8-098C-4511-B147-F31241FC7724@pobox.com> <34022C74-BE1B-40DB-940A-57632AE6A98A@apache.org> <7B58C5C8-388D-4CFC-B2B1-A473591E4CA2@pobox.com> X-Mailer: Apple Mail (2.930.3) X-Virus-Checked: Checked by ClamAV on apache.org On Jan 1, 2009, at 8:24 PM, Geir Magnusson Jr. wrote: > I know I can do that. And if CouchDB is the only "JSON source" that > my apps are talking to, then that's fine - all apps can be written > to expect that "schema". > > But I'm taking a different POV - where a "schema" exists outside of > my app (a pseudo-standard defined by someone else) and I want to use > CouchDB as a source of documents that conform to that schema. My > apps should be able to consume documents in that "JSON schema" that > are sourced from CouchDB, a httpd server returning static documents, > some servlet app running in Tomcat, some .NET thingy, etc. > > Once you force me to store documents in a new format in order to > protect data in my document that clashes w/ the server's metadata by > sticking the document of interest in a top-level field : Isn't this any issue with any data store? It's established that _id is arbitrary just like it could be in just about any other data store. If this is a problem in couchdb it's a problem for you in any data store isn't it? > { > _rev : ... > _id : ... > mydata : { ... the real document ... } > } > > then I think that CDB loses something in terms of being a general > JSON document store. You're looking at couchdb's document as if it's your JSON document. It's couchdb's document and it happens to be JSON. There is nothing at all wrong with the above "schema" and it's arguably the best way to store a document that you don't want to conflict. The couchdb document is always going to need metadata. If it's not in _id then it's _farfagnugen and someone will inevitably have the same issue. > Now, I realize that no one ever said that CDB is a general JSON > document store, rather it's a datastore that happens to return data > in JSON. The different is subtle, but very important. It will be > interesting to see how this space ("document databases") plays out, > and if my concerns are valid. Time will tell, I guess. > > BTW, for maximum utility, I think that the view API will have to > change as well. There's incredible power in the CDB view model, but > you'll want to be able to return a pure "user document" from a call > to a view (conform to some specific "schema"), rather than at least > what I understand is the current metadata-oriented structure. > > geir > > > > > On Jan 1, 2009, at 7:53 PM, Damien Katz wrote: > >> Why can't you just always stick the desired document into an body >> field on the document? If you always do that, then you can round >> trip without problem. >> >> -Damien >> >> >> On Jan 1, 2009, at 7:17 PM, Geir Magnusson Jr. wrote: >> >>> >>> On Jan 1, 2009, at 7:14 PM, Adam Kocoloski wrote: >>> >>>> On Jan 1, 2009, at 4:45 PM, Geir Magnusson Jr. wrote: >>>> >>>>> b) I should have the choice to not have it injected at all >>>>> >>>>> So why do I think this is a problem? The 10gen appserver auto- >>>>> injects an id field into the JSON documents that are stored in >>>>> our database, Mongo. Can you guess what the key is? Yep - "_id" >>>>> >>>>> So how can I roundtrip a doc from 10gen through couch and back? >>>>> I can't. >>>> >>>> Perhaps its worth noting that CouchDB is perfectly comfortable >>>> with externally generated _ids. It only injects an _id if you >>>> create a new document without one. Best, >>> >>> I understand that. >>> >>> I was just pointing out a real-world case where a JSON doc from >>> "somewhere else" runs into trouble... (and yes, the issue applies >>> equally to the 10gen platform, when coming from "somewhere else" :) >>> >>> geir >>> >>>> >> >