couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Iriele <siriele...@gmail.com>
Subject Re: Bad special document member: __VERSION__
Date Fri, 28 Dec 2012 22:52:19 GMT
Hey which couchdb version are you using?...is this 1.2? Or later?. I
noticed that an underscore was used for reserved words so I just  prepend
some some special characters in its place to avoid that.

On Dec 28, 2012 5:38 PM, "Paulo Edgar Castro" <pauloedgarcastro@gmail.com>
wrote:
>
> Hi all,
>
> I just bumped into this error in the subject.
> Upon further digging as per commit
d748a328aec166047c81bcaf3dec6b0a885a2088, keys starting with an underscore
are not accepted as valid...
>
> DB="http://127.0.0.1:5984/mydb"
> curl -X PUT $DB
> curl -H "Content-Type:application/json"  -d
'{"docs":[{"key":"baz","_name":"bazzel"},{"key":"bar","_name":"barry"}]}'
-X POST $DB/_bulk_docs
>
> {"error":"doc_validation","reason":"Bad special document member: _name"}
>
> Some modules I'm using as part of a project try to serialize a whole
class and some of the keys are serialized with underscores.
> This means that CouchDB stops being an option for storage.
>
> Is there a good reason for this design decision ?
> Couldn't the underscore keys be validated against the set of reserved
words or similar ?
> Could this be something not serving a useful purpose ?
>
> Also, I couldn't find any meaningful caveat about this in the wiki ...
>
> Regards,
>
>
>
>                 PECastro
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message