incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: Proposal regarding reserved names
Date Thu, 29 Oct 2009 22:59:39 GMT
On Thu, Oct 29, 2009 at 6:47 PM, Julian Goacher
<julian.goacher@gmail.com> wrote:
> Hello,
>
> With respect to http://wiki.apache.org/couchdb/Reserved_words: I'm a
> developer currently writing an application framework layered over couchdb.
> The framework needs to annotate  user documents with additional state
> information. Prior to recent releases, my framework used property names
> beginning with an underscore to store these annotations (following the
> convention that such names are separate from the user data). As things
> stand, this is no longer possible, but I was wondering if the couchdb dev
> team would consider allocating a specific property name - e.g. something
> like _meta - specifically for this use case. The idea would be that the
> property could then be used by third party developers to house any values
> considered orthogonal to the document data.
>
> Example:
>
> {
>    "_meta":{
>        "plink_framework_property_a": 23,
>        "plink_framework_property_b": "2009-10-29T00:00:00Z"
>    }
> }
>
>
> Regards,
>
> /julian
>

Julian,

There have been a few discussions on this. In the past the suggestion
has always been to nest any user specified data in an object to avoid
name collisions. Something akin to:

{
    "_id": "foo",
    "_rev": "2-32acbd",
    "plink_framework_property_a": 23,
    "plink_framework_property_b": "2009-10-29T00:00:00Z",
    "body": {
        // user data here
    }
}

Paul Davis

Mime
View raw message