couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From francisco treacy <francisco.tre...@gmail.com>
Subject Re: underscores in json keys
Date Wed, 26 Aug 2009 22:30:54 GMT
Makes sense.

Thanks, Paul.

Francisco

2009/8/27 Paul Davis <paul.joseph.davis@gmail.com>:
> On Wed, Aug 26, 2009 at 6:03 PM, francisco
> treacy<francisco.treacy@gmail.com> wrote:
>> Oh, ok.
>>
>> This means the cornerstone of my library is built upon a bug :)
>
> I wouldn't say that. There's nothing that keeps your library from
> reserving a prefix for its internal use. You're free to use anything
> like $ or # or even use a _ suffix.
>
>> Is there any way I can define such a key, in order to interfere as
>> less as possible with library user's data? (i was thinking perhaps
>> externals some way to define some "reserved" keys?)
>
> The only two approaches would be convention and nesting. If you want
> to make sure you can store anything at all with the library, the only
> real answer is to create an object like {"_id": "foo", "user_data":
> ...} but just using another non-underscore prefix wouldn't be too far
> out of the question. Granted you might want to see if anyone else has
> nominated one for consistency across libraries.
>
> HTH,
> Paul Davis
>

Mime
View raw message