Return-Path: X-Original-To: apmail-couchdb-dev-archive@www.apache.org Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 69D7610AA5 for ; Tue, 3 Dec 2013 18:12:23 +0000 (UTC) Received: (qmail 42536 invoked by uid 500); 3 Dec 2013 18:12:23 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 42445 invoked by uid 500); 3 Dec 2013 18:12:23 -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 42437 invoked by uid 99); 3 Dec 2013 18:12:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Dec 2013 18:12:22 +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: domain of kxepal@gmail.com designates 209.85.212.175 as permitted sender) Received: from [209.85.212.175] (HELO mail-wi0-f175.google.com) (209.85.212.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Dec 2013 18:12:18 +0000 Received: by mail-wi0-f175.google.com with SMTP id hi5so7010403wib.14 for ; Tue, 03 Dec 2013 10:11:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=lEdSpu8QpIASDGoXxiM6+q1ugrgDJJkSg3PhH8jkTH8=; b=giae4uq7wCENNS3NwRNCrQffllIwlRLHBQ9a4D8lOlQS7pRv4tJtFPy0QyeotOpu9Y f5aRaiii/K3e8Y0y0VKPih9rYFsgACqJLij8pvNNT5ZiCwX8mRrcWnN7pnEY6JfdFZ0f lnxsYegYI/H9iLoGqtQguSBLxzHEJf3LKLrWVct+exTLB13dyP6ZP91H7gwl2HzmEMxE RjqcZ4GoHRbz+9AzQF3OhhgpJI8X691RAwwyijPh4IZUiIm7MMfXA6ZQY08zG0i9F8KE YCB2FsQFEsDm5S+k8THTNU3PEV3lRJOVxlAkslloz2dH6nVd7RGGvqdmqqYfrJskTNI4 9p9g== MIME-Version: 1.0 X-Received: by 10.180.75.115 with SMTP id b19mr3673093wiw.19.1386094317155; Tue, 03 Dec 2013 10:11:57 -0800 (PST) Received: by 10.180.24.99 with HTTP; Tue, 3 Dec 2013 10:11:57 -0800 (PST) Received: by 10.180.24.99 with HTTP; Tue, 3 Dec 2013 10:11:57 -0800 (PST) In-Reply-To: <529DFA3E.3010706@gmail.com> References: <529DE44C.4090400@bigbluehat.com> <529DFA3E.3010706@gmail.com> Date: Tue, 3 Dec 2013 22:11:57 +0400 Message-ID: Subject: Re: [PROPOSAL] new underscore namespacing From: Alexander Shorin To: dev@couchdb.apache.org Content-Type: multipart/alternative; boundary=f46d043be23c663ce504eca53bdc X-Virus-Checked: Checked by ClamAV on apache.org --f46d043be23c663ce504eca53bdc Content-Type: text/plain; charset=UTF-8 +1 for meta. It's cool idea and every doc has some meta info like type field -1 on /_/ url thing. It's ugly and not related to reserved namespace: you may define any named handler in config file and having _ prefix saves you from collision with atts (but it's still optiona) On Dec 3, 2013 7:37 PM, "Volker Mische" wrote: > On 12/03/2013 03:01 PM, Benjamin Young wrote: > > Hi all, > > > > Recently the "doc._*" reservation has been causing me trouble when > > pulling in "arbitrary" JSON from various sources that also use the > > underscore prefixed names for things (HAL [1], vnd.error [2], other > > APIs). I've also hit the wall several times when trying to import > > filesystem contents (Sphinx, ghpages, and the like) that use _* > > prefixing for their "special folders." > > > > As such, I'd like to propose the following: > > 1. Begin storing new reserved terms in doc._.* (rather than doc._*). > > - this gives developers one object to look into for the meta-data about > > a doc > > - you can see the scope creep of our current doc._* best in the > > replicator status messages. > > - doc._ replication_* would become doc._.replication.* > > 2. Move "magic" API endpoints under "/_/" term as well (for the sake of > > attachments. > > - _design/doc would stay the same > > - but the child endpoints would live under "_design/doc/_/*" > > - _design/doc/_/view/by_date > > - _design/doc/_/list/by_date/ul > > - _design/doc/_/rewrite > > > > I realize these are extreme API shifts, and would need to wait for > > CouchDB 2.0. > > > > The first steps this direction would be to put new reserved word keys > > into a "doc._.*" namespace going forward. Closer to the "cut over" for > > 2.0 duplicates of the existing keys (doc._id, doc._rev, especially) > > could also live at their new underscore prefixed names (doc._.id, > > doc._.rev) which would give devs a chance to migrate code and content. > > > > Doing this would: > > 1. Give us "limitless" space to add content. > > 2. Encourage a namespacing pattern for things like doc._.replication.* > > or other logically grouped content. > > 3. Free up CouchDB to accept a far broader range of content and remove > > the "hey, you can't put that there! I was here first!" errors. :) > > > > Thanks for considering this, > > Benjamin > > > > [1] http://stateless.co/hal_specification.html > > [2] https://github.com/blongden/vnd.error > > Hi, > > I personally would prefer to have the meta information completely > separate from the document. I know there have been discussion in the > past to even have them separate in the backend (but that's not the point > of this proposal). > > So the API for the view function could change to `function(doc, meta)`. > This way you could store in your document whatever you like. > > Cheers, > Volker > > > > --f46d043be23c663ce504eca53bdc--