I have defined a permits
field for a couchdb document like below. I cannot access permits
content by *.permits.db
I wonder if anybody knows how I can do that.
Asked
Active
Viewed 87 times
0

Megidd
- 7,089
- 6
- 65
- 142
1 Answers
2
The cause of your problem is that the value of the permits
attribute is badly formatted. You have a string
rather than an object.
Change:
"{db: ['TEL', 'PPT',]}"
With:
{"db": ["TEL", "PPT"]}
Please note that if your JSON is not formatted correctly (see JSON specification), it will be automatically turned by CouchDB admin interface into a string. Therefore remember:
- to use double quotes around object keys,
- to use double quotes around object values,
- not to use a comma at the end of an array.

Aurélien Bénel
- 3,775
- 24
- 45
-
Or, use a JSON library rather than encoding it yourself. – OrangeDog Jan 24 '17 at 13:21