Return-Path: Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: (qmail 55185 invoked from network); 2 Jan 2009 01:25:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jan 2009 01:25:04 -0000 Received: (qmail 48746 invoked by uid 500); 2 Jan 2009 01:25:03 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 48716 invoked by uid 500); 2 Jan 2009 01:25:03 -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 48704 invoked by uid 99); 2 Jan 2009 01:25:03 -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 17:25:03 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: 216.86.168.178 is neither permitted nor denied by domain of geir@pobox.com) Received: from [216.86.168.178] (HELO mxout-03.mxes.net) (216.86.168.178) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Jan 2009 01:24:54 +0000 Received: from [10.0.1.194] (unknown [67.86.14.166]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 97B6C23E3FC for ; Thu, 1 Jan 2009 20:24:30 -0500 (EST) Message-Id: <7B58C5C8-388D-4CFC-B2B1-A473591E4CA2@pobox.com> From: "Geir Magnusson Jr." To: user@couchdb.apache.org In-Reply-To: <34022C74-BE1B-40DB-940A-57632AE6A98A@apache.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v929.2) Subject: Re: Changing rev to _rev in view results (Was: Re: newbie question #1) Date: Thu, 1 Jan 2009 20:24:29 -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> X-Mailer: Apple Mail (2.929.2) X-Virus-Checked: Checked by ClamAV on apache.org 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 : { _rev : ... _id : ... mydata : { ... the real document ... } } then I think that CDB loses something in terms of being a general JSON document store. 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 >> >>> >